Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/totherik/jase
Simple CLI tool for modifying JSON data.
https://github.com/totherik/jase
Last synced: about 1 month ago
JSON representation
Simple CLI tool for modifying JSON data.
- Host: GitHub
- URL: https://github.com/totherik/jase
- Owner: totherik
- Created: 2015-01-15T22:43:41.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-10-07T15:28:42.000Z (about 9 years ago)
- Last Synced: 2024-11-02T05:23:52.796Z (about 1 month ago)
- Language: JavaScript
- Size: 212 KB
- Stars: 18
- Watchers: 2
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
jase
====A simple command line utility for extracting data from and writing data to JSON-formatted data structures.
```
Usage:
jase [options]Arguments:
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 The JSON file to read.
-s, --set The new value to set for the provided key.
-d, --delete Delete the provided key.
-i, --indent The number of spaces to indent the newly written JSON.Example:
jase ./package.json scripts.test```
### Basic Examples
#### Retrieve a value (specifying a JSON file)
```bash
$ jase scripts -f package.json
{
"test": "tape test/*.js"
}$ jase scripts.test -f package.json
"tape test/*.js"
```#### Retrieving a value (piping JSON to stdin)
```bash
$ cat ./package.json | jase scripts
{
"test": "tape test/*.js"
}$ cat ./package.json | jase scripts.test
"tape test/*.js"
```### Sample Uses
#### Get a property
```bash
$ cat package.json | jase author
```#### Get a nested property
```bash
$ cat package.json | jase scripts.test
```#### Add a property
Chain operations and do things like add nested properties.
```bash
$ cat package.json | jase config -s {} | jase config.port -s 8000
```#### Delete a property
```bash
$ cat package.json | jase scripts -d
```#### Reformat a file
Convert a JSON file with 2-space indenting to 4-space
```bash
$ cat package.json | jase "" -i 4
```