Const
Paints an AST node with colors and formatting using ANSI escape codes Convenience wrapper around paint() that uses the ansi_policy
The AST node to paint
Optional configuration. Defaults will be used for any missing values.
The painted string representation of the node with ANSI color codes
const ast = parse_string('{"name": "John"}');const painted = paint_ansi(ast); // Uses ANSI policy with defaultsconsole.log(painted); Copy
const ast = parse_string('{"name": "John"}');const painted = paint_ansi(ast); // Uses ANSI policy with defaultsconsole.log(painted);
const ast = parse_string('{"name": "John"}');const options = { palette: forestPalette };const painted = paint_ansi(ast, options);console.log(painted); Copy
const ast = parse_string('{"name": "John"}');const options = { palette: forestPalette };const painted = paint_ansi(ast, options);console.log(painted);
Paints an AST node with colors and formatting using ANSI escape codes Convenience wrapper around paint() that uses the ansi_policy