App-SerializeUtils
view release on metacpan or search on metacpan
- pp-dd: Add option --undump (and --eval).
0.11 2017-02-28 Released-By: PERLANCAR
- Add utilities: pp-yaml, pp-dd.
0.10 2016-03-09 Released-By: PERLANCAR
- Replace JSON -> JSON::MaybeXS, JSON::XS -> Cpanel::JSON::XS.
0.09 2015-12-29 Released-By: PERLANCAR
- pp-json: Use canonical().
0.08 2015-04-14 Released-By: PERLANCAR
- Add *ddc scripts (Data::Dump::Color), these output are nicer for
"develop" : {
"requires" : {
"Pod::Coverage::TrustPod" : "0",
"Test::Perl::Critic" : "0",
"Test::Pod" : "1.41",
"Test::Pod::Coverage" : "1.08"
}
},
"runtime" : {
"requires" : {
"Cpanel::JSON::XS" : "0",
"Data::Dmp" : "0.241",
"Data::Dump" : "0",
"Data::Dump::Color" : "0.246",
"Data::Dump::SExpression" : "0",
"Data::Dumper" : "0",
"Data::Dumper::Compact" : "0",
"Data::Undump" : "0",
"Getopt::Long" : "2.50",
"Getopt::Long::Complete" : "0",
"JSON::Color" : "0",
"is_trial" : 0
},
"version" : "6.024"
}
},
"x_authority" : "cpan:PERLANCAR",
"x_contributors" : [
"Steven Haryanto <stevenharyanto@gmail.com>"
],
"x_generated_by_perl" : "v5.34.0",
"x_serialization_backend" : "Cpanel::JSON::XS version 4.26",
"x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later",
"x_static_install" : 1
}
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: '1.4'
name: App-SerializeUtils
provides:
App::SerializeUtils:
file: lib/App/SerializeUtils.pm
version: '0.165'
requires:
Cpanel::JSON::XS: '0'
Data::Dmp: '0.241'
Data::Dump: '0'
Data::Dump::Color: '0.246'
Data::Dump::SExpression: '0'
Data::Dumper: '0'
Data::Dumper::Compact: '0'
Data::Undump: '0'
Getopt::Long: '2.50'
Getopt::Long::Complete: '0'
JSON::Color: '0'
Makefile.PL view on Meta::CPAN
"script/yaml2phpser",
"script/yaml2sereal",
"script/yaml2sexp",
"script/yaml2storabls",
"script/yaml2yaml"
],
"LICENSE" => "perl",
"MIN_PERL_VERSION" => "5.010001",
"NAME" => "App::SerializeUtils",
"PREREQ_PM" => {
"Cpanel::JSON::XS" => 0,
"Data::Dmp" => "0.241",
"Data::Dump" => 0,
"Data::Dump::Color" => "0.246",
"Data::Dump::SExpression" => 0,
"Data::Dumper" => 0,
"Data::Dumper::Compact" => 0,
"Data::Undump" => 0,
"Getopt::Long" => "2.50",
"Getopt::Long::Complete" => 0,
"JSON::Color" => 0,
Makefile.PL view on Meta::CPAN
"Test::More" => 0
},
"VERSION" => "0.165",
"test" => {
"TESTS" => "t/*.t"
}
);
my %FallbackPrereqs = (
"Cpanel::JSON::XS" => 0,
"Data::Dmp" => "0.241",
"Data::Dump" => 0,
"Data::Dump::Color" => "0.246",
"Data::Dump::SExpression" => 0,
"Data::Dumper" => 0,
"Data::Dumper::Compact" => 0,
"Data::Undump" => 0,
"File::Spec" => 0,
"Getopt::Long" => "2.50",
"Getopt::Long::Complete" => 0,
[@Author::PERLANCAR]
:version=0.606
[Prereqs / TestRequires]
;Test::More=0.98
[Prereqs]
perl=5.010001
strict=0
warnings=0
Cpanel::JSON::XS=0
Data::Dmp=0.241
Data::Dump=0
Data::Dump::Color=0.246
Data::Dump::SExpression=0
Data::Dumper=0
Data::Dumper::Compact=0
Data::Undump=0
Getopt::Long=2.50
Getopt::Long::Complete=0
JSON::Color=0
script/check-json view on Meta::CPAN
'help' => sub {
print "Usage: check-json [--pp|--xs] <file>\n";
exit 0;
},
);
my $json;
if ($json_mod eq 'PP') {
require JSON::PP; $json = JSON::PP->new->allow_nonref;
} elsif ($json_mod eq 'XS') {
require Cpanel::JSON::XS; $json = Cpanel::JSON::XS->new->allow_nonref;
} else {
require JSON::MaybeXS; $json = JSON::MaybeXS->new->allow_nonref;
}
eval {
undef $/;
$json->decode(~~<>);
};
die $@ if $@;
script/check-json view on Meta::CPAN
=over
=item * --pp
Force using a PP module (currently L<JSON::PP>) instead of the default
L<JSON::MaybeXS>.
=item * --xs
Force using an XS module (currently L<Cpanel::JSON::XS>) instead of
the default L<JSON::MaybeXS>.
=back
=head1 HOMEPAGE
Please visit the project's homepage at L<https://metacpan.org/release/App-SerializeUtils>.
=head1 SOURCE
script/pp-json view on Meta::CPAN
undef $/;
my $json;
my $res;
if ($mod eq 'pp') {
require JSON::PP; $json = JSON::PP->new;
$json->canonical->allow_nonref->pretty($pretty);
$res = $json->encode($json->decode(scalar <>));
} elsif ($mod eq 'xs') {
require Cpanel::JSON::XS; $json = Cpanel::JSON::XS->new;
$json->canonical->allow_nonref->pretty($pretty);
$res = $json->encode($json->decode(scalar <>));
} else {
require JSON::MaybeXS; $json = JSON::MaybeXS->new;
$json->canonical->allow_nonref->pretty($pretty);
if ($color) {
require JSON::Color;
$res = JSON::Color::encode_json($json->decode(scalar <>), {pretty=>$pretty});
} else {
$res = $json->encode($json->decode(scalar <>));
script/pp-json view on Meta::CPAN
Instead of pretty-printing, print compact JSON.
=item * --pp
Force using a PP module (currently L<JSON::PP>) instead of the default
L<JSON::MaybeXS>.
=item * --xs
Force using an XS module (currently L<Cpanel::JSON::XS>) instead of
the default L<JSON::MaybeXS>.
=back
=head1 ENVIRONMENT
=head2 COLOR
Boolean. Set default for color.
( run in 0.565 second using v1.01-cache-2.11-cpan-fd5d4e115d8 )