Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

stylized-json

outpox12MIT1.1.0

Format and style a json object to display it in HTML

json, html, style, css, parse

readme

I needed a npm package version of this snippet so I created it. Although please note that I'm not the author of the script itself.
The goal of this package is to display a JS object like:

Installation:

npm install stylized-json

Don't forget to include the css file if needed like:
<link rel="stylesheet" href="node_modules/stylized-json/index.css">

Usage:

import stylizedJson from 'stylized-json';

let myObj = {test: {fr_FR: "test", en_US: "test"}},
    myObjToHtml = stylizedJson.prettyPrint(myObj);

document.body.innerHTML += myObjToHtml;