perlancar > JSON-Color > JSON::Color

Download:
JSON-Color-0.07.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.07   Source  

NAME ^

JSON::Color - Encode to colored JSON

VERSION ^

This document describes version 0.07 of JSON::Color (from Perl distribution JSON-Color), released on 2015-04-04.

SYNOPSIS ^

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

DESCRIPTION ^

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.

FUNCTIONS ^

encode_json($data, \%opts) => STR

Encode to JSON. Will die on error (e.g. when encountering non-encodeable data like Regexp or file handle).

Known options:

FAQ ^

What about loading?

Use JSON.

How to handle non-encodeable data?

Use Data::Clean::JSON.

SEE ALSO ^

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.

HOMEPAGE ^

Please visit the project's homepage at https://metacpan.org/release/JSON-Color.

SOURCE ^

Source repository is at https://github.com/perlancar/perl-JSON-Color.

BUGS ^

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=JSON-Color

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHOR ^

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2015 by perlancar@cpan.org.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: