Skip to content

Instantly share code, notes, and snippets.

@Sysetup
Created October 24, 2016 05:14
Show Gist options
  • Save Sysetup/5025b45f18d1034590105c69f96c6150 to your computer and use it in GitHub Desktop.
Save Sysetup/5025b45f18d1034590105c69f96c6150 to your computer and use it in GitHub Desktop.
Ways to print JSON per console
var http = require("http");
//Ways to print JSON per console:
console.log('http: '+http);
console.log(JSON.stringify(http, null, 4));
console.log(JSON.parse(JSON.stringify(http, null, 4)));
console.dir(http.METHODS);
for (i in http.METHODS) {
console.log(http.METHODS[i]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment