Update docs.md

js-version
Anton Medvedev 6 years ago committed by GitHub
parent 8999dee7d6
commit 1742da02f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -122,6 +122,27 @@ curl 'https://api.github.com/repos/facebook/react/commits?per_page=100' \
> export NODE_PATH=/usr/local/lib/node_modules > export NODE_PATH=/usr/local/lib/node_modules
> ``` > ```
## Edit in place
Add next code to your _.fxrc_ file:
```js
const fx = require('fs')
global.save = json => {
fs.writeFileSync(process.argv[2], JSON.stringify(json, null, 2))
return json
}
```
Usage:
```bash
fx data.json '{...this, count: this.count+1}' save .count
```
## Formatting ## Formatting
If you need something different then JSON (for example arguments for xargs) do not return anything from reducer. If you need something different then JSON (for example arguments for xargs) do not return anything from reducer.

Loading…
Cancel
Save