# jq2

> extract json data

Latest version **1.0.1** (published 2016-04-05) · MIT license · 0 weekly downloads

## Install

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

Provides the command `jq2`.

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2016-04-05 |
| First published | 2016-04-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Moshe Kolodny |
| Maintainers | kolodny |
| Keywords | json, jq, cli |

## Links

- npm: https://www.npmjs.com/package/jq2
- Repository: https://github.com/kolodny/jq2
- Homepage: https://github.com/kolodny/jq2#readme
- Issues: https://github.com/kolodny/jq2/issues
- npm.io page: https://npm.io/package/jq2

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^4.7.0

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

- 1.0.1 (latest) — 2016-04-05
- 1.0.0 — 2016-04-03

## README

# jq2
extract json data

[![NPM version][npm-image]][npm-url]
[![Build status][travis-image]][travis-url]
[![Downloads][downloads-image]][downloads-url]

### install

```bash
npm install -g jq2
```

### usage

```
jq2 <lookupstring> [filename]
```

if no filename is provided it will use stdin.
`$` in the `<lookupstring>` is a reference to the javascript object.

### examples

```bash
echo '{"a": {"b": [ 123 ]}}' | jq2 '$.a.b[0]' #123
echo '{"a": {"b": [ 123 ]}}' | jq2 'Math.pow($.a.b[0], 2)' #15129
echo '[" foo bar "," baz "]' | jq2 '$.map(s => s.trim()).join("")' #foo barbaz

# lodash is included so this will work too
echo '[" foo bar ", " baz "]' | jq2 '$.map(_.trim).join("")' #foo barbaz

echo '{"a": 123}' > file.json
jq2 '$.a' file.json #123
```


[npm-image]: https://img.shields.io/npm/v/jq2.svg?style=flat-square
[npm-url]: https://npmjs.org/package/jq2
[travis-image]: https://img.shields.io/travis/kolodny/jq2.svg?style=flat-square
[travis-url]: https://travis-ci.org/kolodny/jq2
[downloads-image]: http://img.shields.io/npm/dm/jq2.svg?style=flat-square
[downloads-url]: https://npmjs.org/package/jq2

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