{ } jq-lite

Installation

On this pageRequirementsCPANAlpine LinuxDockerFrom a release archiveUser-local usageWindows / PowerShellFirst query
このページの目次必要な環境CPANから導入Alpine LinuxDockerリリースアーカイブから導入ユーザーローカルで使うWindows・PowerShell最初のクエリ

必要な環境

Perl 5.14以上が必要です。オフラインへ導入する場合は、配布アーカイブと宣言された依存モジュールを事前に準備してください。

CPANから導入

cpanm JQ::Lite
jq-lite -v

Alpine Linux

apk add jq-lite
jq-lite -v

Docker

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

リリースアーカイブから導入

CPANからJQ-Liteのリリースアーカイブを取得し、以下のVERSIONをダウンロードしたバージョンに置き換えてください。

tar xzf JQ-Lite-VERSION.tar.gz
cd JQ-Lite-VERSION
perl Makefile.PL
make
make test
sudo make install

ユーザーローカルで使う

アーカイブを展開し、必要な依存を利用可能にした後、配布物のbinディレクトリーをPATHへ追加します。

export PATH="$PWD/JQ-Lite-VERSION/bin:$PATH"
jq-lite -v

Windows・PowerShell

リポジトリ付属のPowerShellインストーラーへ、取得したリリースアーカイブを渡します。管理者権限は不要です。

.\install-jq-lite.ps1 JQ-Lite-VERSION.tar.gz

最初のクエリ

printf '{"users":[{"name":"Alice"},{"name":"Bob"}]}\n' | jq-lite '.users[].name'

結果:

"Alice"
"Bob"

APIから利用する場合はPerl組み込みガイドを参照してください。

Requirements

Perl 5.14 or later. Prepare the distribution and its declared dependencies before installing in an offline environment.

CPAN

cpanm JQ::Lite
jq-lite -v

Alpine Linux

apk add jq-lite
jq-lite -v

Docker

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

From a release archive

Obtain a JQ-Lite release archive from CPAN, then replace VERSION below with the downloaded version.

tar xzf JQ-Lite-VERSION.tar.gz
cd JQ-Lite-VERSION
perl Makefile.PL
make
make test
sudo make install

User-local usage

After extracting the archive and making its dependencies available, add the distribution's bin directory to PATH.

export PATH="$PWD/JQ-Lite-VERSION/bin:$PATH"
jq-lite -v

Windows / PowerShell

The repository includes a PowerShell installer. Run it with a downloaded release archive. Administrator privileges are not required.

.\install-jq-lite.ps1 JQ-Lite-VERSION.tar.gz

First query

printf '{"users":[{"name":"Alice"},{"name":"Bob"}]}\n' | jq-lite '.users[].name'

Output:

"Alice"
"Bob"