https://github.com/fujiharuka/jk
https://github.com/fujiharuka/jk
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/fujiharuka/jk
- Owner: FujiHaruka
- Created: 2022-09-03T12:29:47.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-04T10:51:31.000Z (almost 3 years ago)
- Last Synced: 2025-01-08T04:13:01.570Z (5 months ago)
- Language: TypeScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# jk - Command to list JSON key paths
A command to list JSON key paths that are compatible with
[`jq`](https://stedolan.github.io/jq/).```
$ echo '{"foo": { "bar": [{"baz1": 1}, {"baz2": 2}] }}' | jk
.foo
.foo.bar
.foo.bar[0]
.foo.bar[0].baz1
.foo.bar[1]
.foo.bar[1].baz2
```## Installation
```
$ deno install -n jk https://raw.githubusercontent.com/FujiHaruka/jk/main/cli.ts
```## Example Usage
You can use it with [`fzf`](https://github.com/junegunn/fzf) and
[`jq`](https://stedolan.github.io/jq/) to interactively search JSON by key
paths.```
$ cat example.json | jk | fzf --preview "jq {} example.json"
```## Development
Run tests.
```
$ deno test --allow-read --allow-run
```