@mmkal/jsonata
v2.2.1
Published
JSON query and transformation language. Can run synchronously or asynchronously.
Maintainers
Readme
JSONata
JSON query and transformation language
Reference implementation of the JSONata query and transformation language.
Installation
npm install @mmkal/jsonata
Quick start
Presumably you are using @mmkal/jsonata rather than the upstream jsonata because you want the synchronous API. Here's how you use it:
In Node.js:
const jsonata = require('@mmkal/jsonata/sync');
const data = {
example: [
{value: 4},
{value: 7},
{value: 13}
]
};
(async () => {
const expression = jsonata('$sum(example.value)');
const result = pression.evaluate(data); // returns 24
})()More information
- JSONata documentation
- JavaScript API
- Intro talk at London Node User Group
Contributing
See the CONTRIBUTING.md for details of how to contribute to this repo.
