@port-labs/jq-node-bindings v1.0.5
jq-node-bindings
This is a library for Node.js that provides C bindings to the jq library. It allows you to use jq to extract and manipulate data from JSON objects in Node.js.
Requirements
To use this library, you must have node-gyp installed on your system. and the following libraries
node-gypnpm install -g node-gypXCode on Mac, gcc on unix Mac
xcode-select --installYum
sudo yum install gcc g++apt-get
sudo apt-get gcc g++The following C\C++ toolchains autoconf make libtool automake Homebrew
brew install autoconf make automake libtoolYum
sudo apt-get install -y autoconf make libtool automakeapt-get
sudo apt-get install -y autoconf make libtool automakeIf the main
pythonversion used by your system is3.12or higher, you will also need to make sure you havesetuptoolsinstalled (see here):python3 -m pip install setuptools
Installation
npm install @port-labs/jq-node-bindingsUsage
Here's an example of how to use the library:
import { exec } from '@port-labs/jq-node-bindings';
const json = { foo: 'bar' };
const input = '.foo';
const result = exec(json, input);
console.log(result); // outputs "bar"The exec function takes two arguments: a JSON object and a jq input string. It returns the result of running the jq program on the JSON object. The result can be of any type supported by jq: object, array, string, number, boolean, or null.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
12 months ago
12 months ago
12 months ago
8 months ago
11 months ago
11 months ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago