Group
Extension

Matches 2

App-JYJ ( I/IN/INGY/App-JYJ-0.0.2.tar.gz, INGY, 2022; MetaCPAN )
App-JYJ/lib/App/JYJ.pod ( view source; MetaCPAN )
ead1 App::JYJ

Convert JSON to YAML to JSON to...

=head2 Synopsis

    $ cat file.json | jyj             # YAML
    $ cat file.json | jyj | jyj       # JSON
    $ cat file.json | jyj | jyj |jyj  # YA
ol called C<jyj>.

It reads stdin.

If it looks like JSON, it prints the YAML dump of the JSON decoding.

If it looks like YAML, it prints the JSON encoding of the YAML load.

That's it.

=head2 Autho
App-JYJ ( I/IN/INGY/App-JYJ-0.0.2.tar.gz, INGY, 2022; MetaCPAN )
App-JYJ/lib/App/JYJ.pm ( view source; MetaCPAN )
nings;

our $VERSION = '0.0.2';

use JSON::PP;
use YAML::PP;
use IO::All;
use Mo;

sub run {
    my $input = io('-')->utf8->all;
    my $output;
    my $json = JSON::PP->new->pretty->indent_length(2);
[]/) {
        my $data = $json->decode($input);
        $output = $yaml->dump($data);
    }
    else {
        my $data = $yaml->load_string($input);
        $output = $json->encode($data);
    }
   

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.