This is a simple Node.js module to read a JSON value from a file. I created this module because I needed to read a JSON value from a file from the CLI. I couldn't find a module that did this, so I created one. This module has no dependencies, and is very small.
npm i -g read-json-value
read-json-value <file> <jsonpath>
The path to the JSON file.
The JSON path to the value you want to read. This could be a simple key, or a path to a nested value (e.g. scripts.test
or dependencies.react
in a package.json
file)
read-json-value package.json version