libjq-js

1.0.2 • Public • Published

Disclaimer

This package is still very new and doesn't support all of the JQ functionality that jq-web provides, but aims to be a light-weight alternative. Instead of wrapping the entire JQ cli like jq-web, we have a custom C wrapper that make calls to the libjq C API directly.

Installation

yarn add libjq-js
or
npm install libjq-js

API

jq.json(json: object, filter: string): Promise<any>

Example

import jq from "libjq-js";
jq.json({ foo: 5 }, ".foo").then(res => console.log(res));

Outputs

5

Getting setup for development

# This can take 5+ minutes,but only needs to be run once
git submodule update --init --recursive
./configure

# Run this everytime you change libjq_wrapper.c, pre.js, or post.js
make jq.js

Package Sidebar

Install

npm i libjq-js

Weekly Downloads

4

Version

1.0.2

License

MIT

Unpacked Size

948 kB

Total Files

5

Last publish

Collaborators

  • michael-gillett