
JSON::Color - Encode to colored JSON

version 0.05

use JSON::Color qw(encode_json);
say encode_json([1, "two", {three => 4}]);

This module generates JSON, colorized with ANSI escape sequences.
To change the color, see the %theme in the source code. In theory you can also modify it to colorize using HTML.

Encode to JSON. Will die on error (e.g. when encountering non-encodeable data like Regexp or file handle).
Known options:
Pretty-print.
Show line number.

Use JSON.

To colorize with HTML, you can try Syntax::Highlight::JSON.
Syntax::SourceHighlight can also colorize JSON/JavaScript to HTML or ANSI escape. It requires the GNU Source-highlight library.

Steven Haryanto <stevenharyanto@gmail.com>

This software is copyright (c) 2012 by Steven Haryanto.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.