Skip to content

Commit 9d2ebcc

Browse files
committed
Update README.md
- Add description about arguments
1 parent f72af44 commit 9d2ebcc

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Of course, this works on **Windows** as well!
6161

6262
**Note:** If a task exited with non zero code, the other tasks and those descendant processes are killed with `SIGTERM` (On Windows, with `taskkill.exe /F /T`).
6363

64-
### Run a mix of sequential and parallel tasks.
64+
### Run a mix of sequential and parallel tasks
6565

6666
```
6767
npm-run-all clean lint --parallel watch:html watch:js
@@ -79,7 +79,20 @@ npm-run-all a b --parallel c d --sequential e f --parallel g h i
7979
3. Third, runs `e` and `f` sequentially.
8080
4. Lastly, runs `g`, `h`, and `i` in parallell.
8181

82-
### Glob-like pattern matching for task names.
82+
### Run with arguments
83+
84+
```
85+
npm-run-all "delay 3000" --parallel watch:*
86+
npm-run-all --parallel "build:* -- --watch"
87+
```
88+
89+
We can enclose by quotes a script name or a pattern to use arguments.
90+
In cases of a pattern, arguments are forwarded to every matched task.
91+
92+
An example: https://gist.github.com/mysticatea/34949629c9e0a01a9e7d
93+
See also: https://docs.npmjs.com/cli/run-script
94+
95+
### Glob-like pattern matching for task names
8396

8497
```
8598
npm-run-all --parallel watch:*
@@ -94,7 +107,7 @@ But, doesn't run sub-sub tasks. e.g. `watch:js:index`.
94107
npm-run-all --parallel watch:**
95108
```
96109

97-
If you use a globstar `**`, runs both sub tasks and sub-sub tasks.
110+
If we use a globstar `**`, runs both sub tasks and sub-sub tasks.
98111

99112
This matching rule is similar to [glob](https://www.npmjs.com/package/glob#glob-primer).
100113
The Difference is one -- the separator is `:`, instead of `/`.
@@ -142,3 +155,5 @@ Run npm-scripts.
142155

143156
`runAll` returns a promise that becomes *fulfilled* when all tasks are completed.
144157
The promise will become *rejected* when any of the tasks exit with a non-zero code.
158+
159+
See also: https://doc.esdoc.org/github.com/mysticatea/npm-run-all/

0 commit comments

Comments
 (0)