Skip to content

Instantly share code, notes, and snippets.

@slikts
Created April 5, 2014 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slikts/9992331 to your computer and use it in GitHub Desktop.
Save slikts/9992331 to your computer and use it in GitHub Desktop.
nodejs console with ANSI syntax highlighting
(function() {
var highlight = require('cardinal').highlight;
var beautify = require('js-beautify').js_beautify;
var log = console.log;
console.log = function() {
log.apply(console, Array.prototype.map.call(arguments, function(x) {
return highlight('(' + beautify(JSON.stringify(x)) + ')');
}));
};
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment