NAME

JQ::Lite - A lightweight jq-like JSON query engine in Perl

VERSION

Version 0.09

SYNOPSIS

use JQ::Lite;

my $jq = JQ::Lite->new;
my @results = $jq->run_query($json_text, '.domain[] | .name');

for my $r (@results) {
    print encode_json($r), "\n";
}

DESCRIPTION

JQ::Lite is a minimal Perl module that allows querying JSON data using a simplified jq-like syntax.

Currently supported features:

  • Dot-based key access (e.g. .users[].name)

  • Optional key access with ? (e.g. .nickname?)

  • Array indexing and flattening (e.g. .users[0], .users[])

  • Built-in functions: length, keys

  • select(...) filters with comparison and logical operators

METHODS

new

my $jq = JQ::Lite->new;

Creates a new JQ::Lite instance.

run_query

my @results = $jq->run_query($json_text, $query);

Runs a query string against the given JSON text.

REQUIREMENTS

This module uses only core Perl modules:

  • JSON::PP

SEE ALSO

JSON::PP

AUTHOR

Kawamura Shingo <pannakoota1@gmail.com>

LICENSE

Same as Perl itself.