Created
February 16, 2016 05:00
-
-
Save leocaseiro/461560bdaa987b72bd6f to your computer and use it in GitHub Desktop.
Pretty print to console in NodeJS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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