
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
print-messages
Advanced tools
Because making console.log easier to read and write is a double edge sword of time saving.
npm install print-messages
pm = require('print-messages');
Besides normal stuff like colored log, warn, success, and error methods, we have 2 more
nodepromiseNode.js usually has callbacks like function(err, result){ ...
user.save(function(er,res){
// String will be green or red depending on er, res
pm.node('user.save results...', er, res);
})
Promises are becoming popular
var promiser = require('when');
willSucceed = promiser.defer()
pm.promise('promise result is(green or red): ', willSucceed.promise);
willSucceed.resolve("resolve is green");
// or we could have done this
//willSucceed.reject("reject is red");
#Examples
####Basic log, warn, success, error

pm.log('log me', 'log me long tim');
pm.warn('warn me', 'warn me long tim');
pm.success('success me', 'success me long tim');
pm.error('error me', 'error me long tim');

// Node callbacks are usually (err, res)
pm.node('some failing save message', 'That failed', null);
pm.node('some success message', null, {
results: 'are cool'
});

promise = require('when');
willSucceed = promise.defer();
willFail = promise.defer();
pm.promise('This is for a promise', willSucceed.promise);
willSucceed.resolve('That works');
pm.promise('Whereas this is for a promise', willFail.promise);
willFail.reject('That fails');
v0.3.0
Updated from coffee-script to js.
Added newLine [=true] and blankLine [=true] options to determine if arguments should be on new lines and if each log should be preceeded by a blank line. Both false looks like this:
pm.newLine = false;
pm.blankLine = false;

Added a way to change colors.
pm.colors.error = 'magenta';
pm.colors.success = 'blue';
pm.init()

v0.2.2
Ensured at least 1 printed message will appear, even if first arg is an object
v0.2.0
Added pm.node_cb for user.save(pm.node_cb('My message might be green or red'))
v0.1.0
Added pm.crash and pm.crash_cb
for promise.otherwise(pm.crash) or promise.otherwise(pm.crash_cb('with message'))
Added pm.error_cb, pm.success_cb, pm.warn_cb, pm.log_cb
for user.save().error(pm.error_cb('it failed)); // logs: 'it failed'.red, errors...
FAQs
We console lots, this handles everything
We found that print-messages demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.