Skip to content

Commit 89eb2b7

Browse files
authored
Update README.md
1 parent b1da303 commit 89eb2b7

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ cat users.json | jqn 'filter(has("email")) | groupBy(flow(get("email"), split("@
4949

5050
Note: the pipe ` | ` **must always** be surrounded by space to be understood by `jqn` as a pipe.
5151

52-
## Examples
52+
### Examples
5353

54-
### Be notified when a JSON value changed
54+
#### Be notified when a JSON value changed
5555

5656
```
5757
while true; do curl -s http://10.10.0.5:9000/api/ce/task?id=AVhoYB1sNTnExzIJOq_k | jqn 'property("task.status"), thru(a => exit(a === "IN_PROGRESS" ? 0 : 1))' || osascript -e 'display notification "Task done"'; sleep 5; done
5858
```
5959

60-
### Open every links from the clipboard
60+
#### Open every links from the clipboard
6161

6262
```
6363
pbpaste | jqn -x -r opn 'split("\n") | forEach(opn)'
@@ -67,6 +67,14 @@ pbpaste | jqn -x -r opn 'split("\n") | forEach(opn)'
6767
- [opn](https://github.com/sindresorhus/opn) is "a better node-open. Opens stuff like websites, files, executables. Cross-platform."
6868

6969

70+
#### Edit a JSON file
71+
72+
This command above rely on [tap](https://lodash.com/docs/4.17.15#tap) to add a propety to a [package.json](https://docs.npmjs.com/cli/v6/configuring-npm/package-json) file [[#89](https://github.com/FGRibreau/jq.node/issues/89)]:
73+
74+
```
75+
jq.node 'tap(x => x.scripts.build= "sass --load-path=./scss ./scss/style.scss:./css/style.css")' < package.json
76+
```
77+
7078
## API Usage
7179

7280
`jq.node` exposes a node API for programmatic use. Require the `jq` function from the main module.

0 commit comments

Comments
 (0)