Files
yunxinwei-uniapp/node_modules/js
geng.tang@qq.com ebd22b0eee 确认收货改造
2024-01-02 21:41:41 +08:00
..
2023-08-04 13:04:21 +08:00
2023-08-04 13:04:21 +08:00
2023-08-04 13:04:21 +08:00
2024-01-02 21:41:41 +08:00
2023-08-04 13:04:21 +08:00

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>

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 'stdin.foo = "bar", stdin' < in.json > out.json