Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including jsonata with all npm packages installed. Try it out:

var jsonata = require("jsonata")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

jsonata v1.6.5

JSON query and transformation language


JSON query and transformation language

NPM statistics

Build Status Coverage Status

Reference implementation of the JSONata query and transformation language.


  • 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">
    <meta charset="UTF-8">
    <title>JSONata test</title>
    <script src=""></script>
      function greeting() {
        var json = JSON.parse(document.getElementById('json').value);
        var result = jsonata('"Hello, " & name').evaluate(json);
        document.getElementById('greeting').innerHTML = result;
    <textarea id="json">{ "name": "Wilbur" }</textarea>
    <button onclick="greeting()">Click me</button>
    <p id="greeting"></p>

More information


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


RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free