JSON::Diffable - A relaxed and easy diffable JSON variant
use JSON::Diffable qw( encode_json decode_json ); $json = encode_json $data; $data = decode_json $json;
This module allows to create a JSON variant that is suitable for easy diffing. This means:
Commas after each hash or array element.
Consistent indentation
One line per entry
The data can be read again by a relaxed JSON parser or the exported "decode_json" function.
my $json = encode_json($data);
Turns a Perl data structure into diffable JSON.
my $data = decode_json($json);
Turns relaxed JSON into a Perl data structure.
Robert Sedlacek <r.sedlacek@shadowcat.co.uk>
The development of this module was sponsored by http://socialflow.com/.
To install JSON::Diffable, copy and paste the appropriate command in to your terminal.
cpanm
cpanm JSON::Diffable
CPAN shell
perl -MCPAN -e shell install JSON::Diffable
For more information on module installation, please visit the detailed CPAN module installation guide.