Skip to content

rpcme/jmespath.pl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jmespath.pl

Build Status Coverage Status CPAN version

Repository for the Jmespath for Perl implementation.

See the Changes file for release notes.

About

JMESPath is a query language for JSON. This repository is the JMESPath implementation for the Perl programming language.

Installation

Although you can install from Github, certainly the better way is to install using CPAN.

$ cpan Jmespath

Usage

JMESPath releases with the command line utility jp.

$ curl -s -XPOST https://fastapi.metacpan.org/v1/author/RICHE | \
    perl -I lib/ script/jp email
"["[email protected]"]"

To remove the quotes, use the JP_UNQUOTED environment variable.

$ curl -s -XPOST https://fastapi.metacpan.org/v1/author/RICHE | \
    JP_UNQUOTED=1 perl -I lib/ script/jp email
["[email protected]"]

Rather,

$ curl -s -XPOST https://fastapi.metacpan.org/v1/author/RICHE | \
    JP_UNQUOTED=1 perl -I lib/ script/jp email[0]
[email protected]

With full JMESPath compliance, for example:

$  curl -s -XPOST https://fastapi.metacpan.org/v1/author/RICHE | \
    JP_UNQUOTED=1 perl -I lib/ script/jp "email[0].length(@)"
14