https://github.com/lukasbach/json-extract-path
CLI tool to extract a variable from a JSON file based on a JSONPath value
https://github.com/lukasbach/json-extract-path
binary cli extract file github-packages json jsonpath npm package typescript
Last synced: 6 months ago
JSON representation
CLI tool to extract a variable from a JSON file based on a JSONPath value
- Host: GitHub
- URL: https://github.com/lukasbach/json-extract-path
- Owner: lukasbach
- License: mit
- Created: 2021-02-06T01:34:37.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-01-05T15:49:14.000Z (almost 3 years ago)
- Last Synced: 2025-02-15T08:28:01.230Z (8 months ago)
- Topics: binary, cli, extract, file, github-packages, json, jsonpath, npm, package, typescript
- Language: JavaScript
- Homepage:
- Size: 70.3 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Json Extract Path
CLI for extracting a value from a JSON file based on a JSONPath input
npx json-extract-path --file ./example.json --jsonpath "$.store.book[*].author"
## How to use
Install globally via
npm install -g json-extract-path
or directly use via
npx json-extract-path
You can also download native binaries under the [Releases Tab](https://github.com/lukasbach/json-extract-path/releases) and use them if you don't want to install NodeJS.
Usage:
Usage: npx json-extract-path [options]
Options:
-V, --version output the version number
-f, --file path to the JSON file
-j, --jsonpath JsonPath value
-d, --delemitterdelemitter character, in case more than one result is returned (default: ";")
-h, --help display help for command## How to develop
- `yarn` to install dependencies
- `yarn start` to run the CLI script for debugging
- `yarn test` to run tests
- `yarn publish` to publish a new version to NPM. Make sure to bump the version!
- `yarn prettier:check` to verify that your code is pretty
- `yarn prettier:write` to make your code pretty