jq-lite — Lightweight jq

JQ::Lite

MetaCPAN Alpine Linux Perl

Project homepage

概 What is jq-lite?

jq-lite is a Pure Perl JSON query engine inspired by jq.

It lets you query and transform JSON using jq-like syntaxwithout external binaries, native libraries, or compilation.

Official Alpine Linux package

apk add jq-lite

JQ::Lite is designed for minimal environments such as:

where simplicity, readability, and low dependency footprint matter.

要 Why jq-lite

試 Quick Start (CLI)

jq-lite '.users[].name' users.json
jq-lite '.users[] | select(.age > 25)' users.json
jq-lite --yaml '.users[].name' users.yaml

Interactive exploration:

jq-lite users.json

境 Environment Support

| Environment | jq | jq-lite | | -------------------- | -- | ------- | | Legacy CentOS / RHEL | 不X | 可O | | Alpine Linux | 条△ | 可O | | Air-gapped systems | 不X | 可O | | No root privilege | 条△ | 可O |

Runs on Perl ≥ 5.14 (e.g. CentOS 6, Debian 7 via perlbrew or local install)

理 Why Pure Perl?

携 Portability

No compilation, no shared libraries. If Perl runs, jq-lite runs.

拡 Extensibility

Extend jq-like behavior directly in Perl.

融 Seamless Perl Integration

use JQ::Lite;

my $jq = JQ::Lite->new;
say for $jq->run_query($json, '.users[].name');

No external command calls. No parsing of CLI output.

軽 Lightweight Installation

保 Maintainability

入 Installation

配 CPAN

cpanm JQ::Lite

林 Alpine Linux

apk add jq-lite

麦 Homebrew (macOS)

brew tap kawamurashingo/jq-lite
brew install --HEAD jq-lite

容 Containers

FROM alpine
RUN apk add --no-cache jq-lite

jq-lite is ideal as a container-standard JSON tool.

移 Portable Installer (Offline)

./download.sh [-v <version>] [-o /path]
./install.sh [-p <prefix>] [--skip-tests] JQ-Lite-<version>.tar.gz

Default:

$HOME/.local

窓 Windows (PowerShell)

.\install-jq-lite.ps1 [-Prefix <path>] [--SkipTests] JQ-Lite-<version>.tar.gz

例 Example Queries

jq-lite '.users[] | select(.profile.active) | .name'
jq-lite '.users | sort_by(.age) | map(.name) | join(", ")'
jq-lite '.users[].nickname? // .name'

書 Documentation

作 Author

川村慎吾 (Shingo Kawamura) pannakoota1@gmail.com

許 License

Same terms as Perl itself.