Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jsonata-js/jsonata
JSONata query and transformation language - http://jsonata.org
https://github.com/jsonata-js/jsonata
Last synced: 5 days ago
JSON representation
JSONata query and transformation language - http://jsonata.org
- Host: GitHub
- URL: https://github.com/jsonata-js/jsonata
- Owner: jsonata-js
- License: mit
- Created: 2016-09-27T13:03:14.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-05-28T08:39:32.000Z (8 months ago)
- Last Synced: 2024-05-29T12:59:50.321Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.42 MB
- Stars: 1,948
- Watchers: 35
- Forks: 209
- Open Issues: 134
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome - jsonata - JSONata query and transformation language - http://jsonata.org (JavaScript)
- awesome-nodejs - jsonata - JSONata query and transformation language - http://jsonata.org ![](https://img.shields.io/github/stars/jsonata-js/jsonata.svg?style=social&label=Star) (Repository / Object / JSON / JSON Schema)
- awesome-list - jsonata - http://jsonata.org | jsonata-js | 1046 | (JavaScript)
README
# JSONata
JSON query and transformation language
Reference implementation of the [JSONata query and transformation language](http://jsonata.org/).
* [JSONata in 5 minutes](https://www.youtube.com/embed/ZBaK40rtIBM)
* [JSONata language documentation](http://docs.jsonata.org/)
* [Try it out!](http://try.jsonata.org/)## Installation
- `npm install jsonata`
## Quick start
In Node.js:
```javascript
const jsonata = require('jsonata');const data = {
example: [
{value: 4},
{value: 7},
{value: 13}
]
};(async () => {
const expression = jsonata('$sum(example.value)');
const result = await expression.evaluate(data); // returns 24
})()
```In a browser:
```html
JSONata test
async function greeting() {
var json = JSON.parse(document.getElementById('json').value);
var result = await jsonata('"Hello, " & name').evaluate(json);
document.getElementById('greeting').innerHTML = result;
}
{ "name": "Wilbur" }
Click me
```
## More information
- JSONata [documentation](http://docs.jsonata.org/)
- [JavaScript API](http://docs.jsonata.org/embedding-extending)
- [Intro talk](https://www.youtube.com/watch?v=TDWf6R8aqDo) at London Node User Group## Contributing
See the [CONTRIBUTING.md](CONTRIBUTING.md) for details of how to contribute to this repo.