Skip to content

Instantly share code, notes, and snippets.

@kshirish
Created February 15, 2015 09:15
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 kshirish/52c9e8f3a307edf2576e to your computer and use it in GitHub Desktop.
Save kshirish/52c9e8f3a307edf2576e to your computer and use it in GitHub Desktop.
node api
// writes to stdout, same as info
console.log('hello %d', 2015);
//writes to stderr, same as warn
console.error('hello %d', 2015);
console.dir({
name: 'John doe',
address: {
city: 'NY',
state: 'DC'
}
});
console.time('time-tick');
setTimeout(function(){
console.timeEnd('time-tick');
}, 4000);
// produces stack trace at the point
var i = 0;
for (;i<4;i++) {
console.trace('trace-message');
}
// throw assert message if first argument is true
console.assert(4 > 7, 'assert-message');
console.assert(4 < 7, 'assert-message');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment