Download the PHP package wikimedia/zest-jq without Composer

On this page you can find all versions of the php package wikimedia/zest-jq. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package zest-jq

Latest Stable Version License

ZestJQ

A PHP and TypeScript implementation of the jq JSON query language. Provides both a library API and a zestjq command-line tool. ZestJQ uses the same license as the original jq code (MIT). We implement jq version 1.8.x (validated against upstream test cases as of May 2026).

This is not a port of the original C codebase, but a reimplementation using the manual and the extensive jq.test file as a guide. Claude Sonnet 4.6 was used to speed portions of the implementation but every line in this code was manually reviewed and I performed extensive clean up and refactoring on Claude's output. (Claude became confused and began to call me "the linter" because I was always altering what it output.)

Claude was a big help porting the numerous built-in functions in the jq standard library. The date-parsing and other related functions imported from C would not be nearly as complete if I had to port these entirely by hand. After the PHP implementation was substantially complete, Claude was used to assist the mostly-mechanical transformation from PHP to TypeScript, although again I reviewed every line and made numerous refinements.

This implementation passes the upstream jq test suite (524 tests) with the following exceptions:

We've also fixed some bugs in delete-path support. Since PHP is a memory-safe language, we expect that we do not have any memory errors either.

Additional documentation can be found on mediawiki.org.

PHP installation

PHP ≥ 8.1 is required. ext-mbstring must be enabled.

PHP library usage

Evaluate a filter against a JSON string

Evaluate a filter against a decoded PHP value

Compile once, evaluate many times

Error handling

Custom definitions

Running PHP tests

Individual test commands:

TypeScript installation

TypeScript library usage (node)

Evaluate a filter against a JSON string

Evaluate a filter against a decoded value

Compile once, evaluate many times

Error handling

TypeScript library usage (browser)

Build the browser bundle from the project root:

This produces three files in dist/browser/:

Via <script> tag (IIFE)

The IIFE bundle exposes all exports as properties of window.ZestJQ:

Via ES module

Compile once, evaluate many times (browser)

Running TypeScript tests

Command-line tool

Our command-line tool is compatible with the upstream jq binary, although we do not implement many command-line options.

Option Description
-n, --null-input Use null as the input instead of reading stdin/files
-r, --raw-output Print strings without JSON quoting
-c, --compact-output Compact JSON output (no pretty-printing)
--ast Print the parsed AST of the filter and exit

Examples:

Cookbook

Common query patterns using a classic store inventory document.

Setup — replace $json / json with the JSON string above:

Get all authors:

Get the first book's title:

Every price field at any nesting depth:

Books cheaper than $10:

Books that have an ISBN:

First two books:

First and last book:

History

Upstream jq was created by Stephen Dolan and is currently maintained by the jqlang community.

ZestJQ was originally implemented by C. Scott Ananian.

For version history since the original implementation, see HISTORY.md.

License and Credits

jq is copyright (C) 2012 Stephen Dolan and contributors. ZestJQ is a clean reimplementation in PHP and does not incorporate the original C source code, but it does include src/builtin.jq and tests/jq.test from the upstream jq project.

The PHP implementation is copyright (C) 2026 Wikimedia Foundation.

Both the original jq codebase and this implementation are distributed under the MIT license; see LICENSE for details.



All versions of zest-jq with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
wikimedia/wikipeg Version ^6.1.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wikimedia/zest-jq contains the following files

Loading the files please wait ...