1.0.0 • Published 7 years ago

@vadzim/js v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 years ago

js

js is a a better alternative to node -p. It will automatically convert data from and to JSON string representations, and will automatically expose enviroment variables as globals preceded with $.

Usage

js <javascript>

stdin variable can be used to access input. $ is a synonym for stdin.

Examples

Using math

js 2+2

Read a field from a JSON file

js stdin.version < package.json

Add a field to a JSON file on the fly

js '$.foo = "bar", $' < in.json > out.json

Promises & streams are resolved automatically

js 'new Promise(resolve => require("http").get("http://google.com", resolve))'

await can be used in the calculated expression if it is supported by node.

1.0.0

7 years ago

0.9.0

7 years ago

0.8.0

7 years ago

0.7.0

7 years ago

0.6.0

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago