# jmespath

> JMESPath implementation in javascript

Latest version **0.16.0** (published 2022-01-19) · Apache-2.0 license · 0 weekly downloads

## Install

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

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.16.0 |
| Published | 2022-01-19 |
| First published | 2014-04-25 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | separate (@types/jmespath) |
| Module format | CommonJS |
| Node | >= 0.6.0 |
| Dependencies | 0 |
| Unpacked size | 79.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 847 |
| Author | James Saryerwinnie |
| Maintainers | jamesls |
| Keywords | jmespath, jsonpath, json, xpath |

## Links

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

## 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

- 0.16.0 (latest) — 2022-01-19
- 0.15.0 — 2016-03-25
- 0.14.1 — 2016-02-19
- 0.14.0 — 2015-11-11
- 0.12.0 — 2015-04-21
- 0.11.0 — 2015-04-10
- 0.10.0 — 2015-02-25
- 0.9.0 — 2015-02-08
- 0.1.0 — 2014-05-19
- 0.0.1 — 2014-04-25

## README

# jmespath.js

[![Build Status](https://travis-ci.org/jmespath/jmespath.js.png?branch=master)](https://travis-ci.org/jmespath/jmespath.js)

jmespath.js is a javascript implementation of JMESPath,
which is a query language for JSON.  It will take a JSON
document and transform it into another JSON document
through a JMESPath expression.

Using jmespath.js is really easy.  There's a single function
you use, `jmespath.search`:


```
> var jmespath = require('jmespath');
> jmespath.search({foo: {bar: {baz: [0, 1, 2, 3, 4]}}}, "foo.bar.baz[2]")
2
```

In the example we gave the ``search`` function input data of
`{foo: {bar: {baz: [0, 1, 2, 3, 4]}}}` as well as the JMESPath
expression `foo.bar.baz[2]`, and the `search` function evaluated
the expression against the input data to produce the result ``2``.

The JMESPath language can do a lot more than select an element
from a list.  Here are a few more examples:

```
> jmespath.search({foo: {bar: {baz: [0, 1, 2, 3, 4]}}}, "foo.bar")
{ baz: [ 0, 1, 2, 3, 4 ] }

> jmespath.search({"foo": [{"first": "a", "last": "b"},
                           {"first": "c", "last": "d"}]},
                  "foo[*].first")
[ 'a', 'c' ]

> jmespath.search({"foo": [{"age": 20}, {"age": 25},
                           {"age": 30}, {"age": 35},
                           {"age": 40}]},
                  "foo[?age > `30`]")
[ { age: 35 }, { age: 40 } ]
```

## More Resources

The example above only show a small amount of what
a JMESPath expression can do.  If you want to take a
tour of the language, the *best* place to go is the
[JMESPath Tutorial](http://jmespath.org/tutorial.html).

One of the best things about JMESPath is that it is
implemented in many different programming languages including
python, ruby, php, lua, etc.  To see a complete list of libraries,
check out the [JMESPath libraries page](http://jmespath.org/libraries.html).

And finally, the full JMESPath specification can be found
on the [JMESPath site](http://jmespath.org/specification.html).

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