json-chalker
A library for colorizing JSON strings, based on json-colorizer.
This package is a simple console syntax highlighter for JSON.
Installation
npm install --save json-chalker
Usage
const colorize = ;console;
Specifying colors
You can specify a color to use for coloring individual tokens by providing a colors
object in the options 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 #
symbol.
const colorize = ;console;
The tokens available are:
BRACE
BRACKET
COLON
COMMA
STRING_KEY
STRING_LITERAL
NUMBER_LITERAL
BOOLEAN_LITERAL
NULL_LITERAL
Custom formatting
You may specify custom formatting like this:
const colorize = ;console;