A simple command line utility for extracting data from and writing data to JSON-formatted data structures.
Usage:
jase <key> [options]
Arguments:
<key> A dot (`.`) delimited key which references the value that should be returned or overwritten.
Escape dot characters in key names using '\', e.g. 'config.foo\.bar'.
Options:
-f, --file <file> The JSON file to read.
-s, --set <value> The new value to set for the provided key.
-d, --delete Delete the provided key.
-i, --indent <spaces> The number of spaces to indent the newly written JSON.
Example:
jase ./package.json scripts.test
$ jase scripts -f package.json
{
"test": "tape test/*.js"
}
$ jase scripts.test -f package.json
"tape test/*.js"
$ cat ./package.json | jase scripts
{
"test": "tape test/*.js"
}
$ cat ./package.json | jase scripts.test
"tape test/*.js"
$ cat package.json | jase author
$ cat package.json | jase scripts.test
Chain operations and do things like add nested properties.
$ cat package.json | jase config -s {} | jase config.port -s 8000
$ cat package.json | jase scripts -d
Convert a JSON file with 2-space indenting to 4-space
$ cat package.json | jase "" -i 4