JSON data with colored syntax – pretty-print-json

Format JSON data with colored syntax using pretty-print-json library.

JavaScript library to pretty-print for JSON data with colored syntax

An interesting tool for processing and formatting JSON as colored syntax. Pass data into prettyPrintJson.toHtml() and display the results.

Format and preview your JSON with pretty-print-json
Format and preview your JSON with pretty-print-json

Setup

npm install pretty-print-json

Sample

HTML

<pre id="account"></pre>

JS

const prettyPrintJson = require('pretty-print-json');

const data = { active: true, codes: [48348, 28923, 39080], city: 'London' };
$('#account').html(prettyPrintJson.toHtml(data));

License: MIT

Homepage

https://pretty-print-json.js.org

GitHub

https://github.com/center-key/pretty-print-json

See also

Enjoy!