Skip to content
JSONata query and transformation language - http://jsonata.org
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode Establish some (common) VS code settings (for those using it) Jan 14, 2018
docs more details Dec 14, 2018
src $each should not result in undefined values in the result object Jan 10, 2019
test
website fix travis.yml Dec 17, 2018
.editorconfig
.eslintignore
.eslintrc fixed ESLint complaints Jun 26, 2017
.gitignore
.npmignore fix travis.yml Dec 17, 2018
.travis.yml fix travis.yml Dec 17, 2018
CHANGELOG.md
CONTRIBUTING.md API documentation (#52) May 24, 2017
DCO1.1.txt
LICENSE
README.md simplify readme Dec 14, 2018
bower.json
functions.md
jsdoc.json first commit Sep 27, 2016
jsonata.d.ts
package.json release v1.6.4 (#294) Jan 11, 2019
polyfill.js extra polyfill required for IE11 Dec 19, 2018
tutorial.md

README.md

JSONata

JSON query and transformation language

NPM statistics

Build Status Coverage Status

Reference implementation of the JSONata query and transformation language.

Installation

  • npm install jsonata

Quick start

In Node.js:

var jsonata = require("jsonata");

var data = {
  example: [
    {value: 4},
    {value: 7},
    {value: 13}
  ]
};
var expression = jsonata("$sum(example.value)");
var result = expression.evaluate(data);  // returns 24

In a browser:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>JSONata test</title>
    <script src="https://cdn.jsdelivr.net/npm/jsonata/jsonata.min.js"></script>
    <script>
      function greeting() {
        var json = JSON.parse(document.getElementById('json').value);
        var result = jsonata('"Hello, " & name').evaluate(json);
        document.getElementById('greeting').innerHTML = result;
      }
    </script>
  </head>
  <body>
    <textarea id="json">{ "name": "Wilbur" }</textarea>
    <button onclick="greeting()">Click me</button>
    <p id="greeting"></p>
  </body>
</html>

More information

Contributing

See the CONTRIBUTING.md for details of how to contribute to this repo.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.