1.0.0-alpha • Published 6 years ago

jerry-quotient v1.0.0-alpha

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
6 years ago

jerry-quotient

Build Status

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 the jq 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.

License

Apache-2.0