Use Node.js to extract JSON values from a JSON file.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
test
.gitignore
.travis.yml
LICENSE
README.md
cli.js
index.js
makefile
package.json

README.md

json-extract

Use Node.js to extract JSON values from a JSON file.

NPM

Build Status Dependency Status

Usage

json-extract --file path/to/a/json/file --key THE_KEY  # will return the value associated with THE_KEY

Nested keys are allowed:

  • --key some.nested.value: will access nested objects.
  • --key an_array.5: will access an array like an_array[5].
  • --key some.nested.array.5: will access the 5th entry in an array that is nested in objects.

Installation

npm install -g json-extract
// install globally

Test

make test

License

MIT