Update docs.md

js-version
Anton Medvedev 5 years ago committed by GitHub
parent 407c034f3b
commit ce4b19cce5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -160,15 +160,17 @@ echo '[1,2,3]' | fx 'this.forEach(x => console.log(x))' 2>/dev/null | xargs echo
Convert object to array: Convert object to array:
```bash ```bash
$ cat package.json | fx 'Object.keys(this.dependencies)' $ cat package.json | fx 'Object.keys(this.dependencies)'
[
"@medv/prettyjson"
]
``` ```
By the way, fx has shortcut for `Object.keys(this)`. Previous example can be rewritten as: Or by two functions:
```bash
$ cat package.json | fx .dependencies Object.keys
```
By the way, fx has shortcut for `Object.keys`. Previous example can be rewritten as:
```bash ```bash
$ cat package.json | fx this.dependencies ? $ cat package.json | fx .dependencies ?
``` ```
## Streaming mode ## Streaming mode

Loading…
Cancel
Save