1.0.0 • Published 9 years ago
ndjson-format v1.0.0
ndjson-format
format your json objects with an es6 template string. you currently need iojs for it to run.
usage
You don't need to use the ticks. Also you might have to use '
instead of "
, because
${}
is usually also used for shell substitutions
echo '{"greet": "hi"}\n{"greet": "hello"}' | ndjson-format '${this.greet}, stranger!'
hi, stranger!
hello, stranger!
you can do more complex things
echo '[1,2,3]\n[3,4,0]' | ndjson-format 'version ${ this.join(".") }'
version 1.2.3
version 3.4.0
1.0.0
9 years ago