Skip to content

Instantly share code, notes, and snippets.

@leocaseiro
Created February 16, 2016 05:00
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 leocaseiro/461560bdaa987b72bd6f to your computer and use it in GitHub Desktop.
Save leocaseiro/461560bdaa987b72bd6f to your computer and use it in GitHub Desktop.
Pretty print to console in NodeJS
function debug() {
if (arguments.length > 1) {
return console.log(arguments[0], JSON.stringify(arguments[1], null, 2));
} else {
return console.log(JSON.stringify(arguments[0], null, 2));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment