A library for colorizing JSON strings
This package is a simple console syntax highlighter for JSON.
npm install --save json-colorizer
const colorize = ;console
If you pass a string to the colorize function, it will treat it as pre-serialized JSON. This can be used in order to colorize pretty-printed JSON:
const colorize = ;const json = JSON;console
NOTE: Prior to version 2.x, the colors were specified by referencing
chalk color functions directly. This required requiring
chalk into the file. Starting with version 2.x, the colors are specified as a string which is the name (or property path) to the desired color function.
You can specify a color to use for coloring individual tokens by providing a
colors object. This should map token types to the names of color functions (see the chalk styles reference).
A color can also be specified as a hex value starting with the
const colorize = ;console;
The tokens available are: