jsol
Installing
npm install -g jsol
Usage
jsol
parses JSON input and pretty prints JSON output:
$ cat package.json | jsol 'pkg => pkg.bin'
{
"jsol": "bin/jsol.js"
}
lodash is available as _
:
$ cat package.json | jsol "pkg => _.pick(pkg, 'name', 'description')"
{
"name": "jsol",
"description": "utility for JavaScript one-liners"
}
An input format can be passed with --fmt
. The default is json
.
The input can be read in as a string with str
.
$ cat package.json | jsol --fmt str 'str => str.length'
244
TODO:
- Support reading lines of text
- Support callbacks
- Support returning a promise