NAME

jpath - Command-line tool for JSON::Path

VERSION

This document describes version 0.04 of jpath (from Perl distribution App-jpath), released on 2016-03-11.

SYNOPSIS

Usage:

% jpath [OPTIONS] <JSONPATH_EXPR> < data.json

DESCRIPTION

This script provides a simple, relatively straightforward command-line interface for JSON::Path. It accepts JSON input as well as several other formats; and similarly can output JSON or alternative formats.

This script sets $JSON::Path::Safe to 0 so you can eval Perl expressions.

EXIT CODES

0 on success.

99 on command-line options error.

OPTIONS

  • --input=STR, -i

    Pick input format. Available formats: json, yaml (using YAML::Syck), perl. Default is json.

  • --output=STR, -o

    Pick output format. Available formats: json, yaml, perl, and pretty (using Data::Format::Pretty::Console). Default is json.

FAQ

How do I turn off colors and line numbers?

Use COLOR=0 and LINUM=0, respectively. For example:

% LINUM=0 jpath ...

See Data::Format::Pretty::JSON and other Data::Format::Pretty::* for more details.

HOMEPAGE

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

SOURCE

Source repository is at https://github.com/perlancar/perl-App-jpath.

BUGS

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

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.

SEE ALSO

JSON::Path.

App::dpath, a similar command-line tool, for Data::DPath.

Someone should perhaps also write tpath for TPath (TPath::Forester::Ref).

jsonpath, jcut (from App::PipeFilter). A command-line tool that works on a per-record basis.

App::jt, a command-line tool that deals specifically with JSON input and in addition to doing JSONPath also provides some extra tools like simple filtering capability for simple structures (e.g. arrays, array of hashes), convert to CSV, etc.

App::SerializeUtils, various command-line scripts to convert or check data structure in various formats.

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2016 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.