jerry-quotient
v1.0.0-alpha
Published
Simple JQ wrapper. Nothing fancy.
Downloads
3
Readme
jerry-quotient
A simple jq wrapper for node.js so you can require
it in your projects. Vaguely based on node-jq.
Install
$ npm i jerry-quotient
Usage
jerry-quotient
exports a single function which can be used like this:
const jq = require('jerry-quotient')
jq('.hello', {hello:'world'}).then((result) => {
// result === 'hello'
})
Here is some more detail:
jq(filter, json) -> result
filter
: A string that will be interpreted as a jq filter.json
: A string or object that thejq
command will evaluate through the filter. If passed as an object, the parameter will be stringified before being evaluated.result
: A string that represents the result of the evaluation.
Testing
$ npm test
To get coverage stats, try using nyc:
$ npx nyc npm test
Contributions
All contributions are welcome: bug reports, feature requests, "why doesn't this work" questions, patches for fixes and features, etc. For all of the above, file an issue or submit a pull request.