DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

Pretty-print JSON in Command Line


Option 1:

npm install -g json
echo '{"foo": "lorem", "bar": "ipsum"}' | json

Option 2:

echo '{"foo": "lorem", "bar": "ipsum"}' | python -m json.tool


Published

Jan 13, 2016

Last Updated

Jan 13, 2016

Category

Tech

Tags

  • command line 14
  • json 7
  • pretty-print 1

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor