Pretty print JSON with Node in the command line
A simple way to print nice and nested Json in the command line using Node.js is to use the "space" argument of JSON.stringify:
JSON.stringify(data, null, '\t')
{
"foo": "lorem",
"bar": "ipsum"
}
Written by Aurélien Thieriot
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Nodejs
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#