ndjson-format

1.0.0 • Public • Published

ndjson-format

NPM

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

Readme

Keywords

Package Sidebar

Install

npm i ndjson-format

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • finnpauls