# jsonata

> JSON query and transformation language

Latest version **2.2.2** (published 2026-07-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install jsonata
pnpm add jsonata
yarn add jsonata
bun add jsonata
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.2.2 |
| Published | 2026-07-16 |
| First published | 2016-09-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 8 |
| Dependencies | 0 |
| Unpacked size | 833.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 2689 |
| Maintainers | jsonata |
| Keywords | JSON, query, transformation, transform, mapping, path |

## Links

- npm: https://www.npmjs.com/package/jsonata
- Repository: https://github.com/jsonata-js/jsonata
- Homepage: http://jsonata.org/
- Issues: https://github.com/jsonata-js/jsonata/issues
- npm.io page: https://npm.io/package/jsonata

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 2.2.2 (latest) — 2026-07-16
- 1.8.9 (latest-v1) — 2026-07-30
- 1.8.8 — 2026-07-16
- 2.2.1 — 2026-05-19
- 2.2.0 — 2026-05-14
- 2.1.1 — 2026-05-12
- 2.1.0 — 2025-07-31
- 2.0.6 — 2024-11-29
- 2.0.5 — 2024-05-09
- 1.8.7 — 2024-03-01
- 2.0.4 — 2024-02-29
- 2.0.3 — 2023-04-18
- 2.0.2 — 2023-02-21
- 2.0.1 — 2023-01-11
- 2.0.0 — 2022-12-15
- … 44 more at https://npm.io/package/jsonata/versions

## 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
<!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>
      async function greeting() {
        var json = JSON.parse(document.getElementById('json').value);
        var result = await 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
- 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.

---
_Source: https://npm.io/package/jsonata · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
