Skip to content

Commit 8c8bec0

Browse files
committed
Docs: update docs
1 parent 8c6debf commit 8c8bec0

File tree

5 files changed

+47
-97
lines changed

5 files changed

+47
-97
lines changed

README.md

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@
1212

1313
A CLI tool to run multiple npm-scripts in parallel or sequential.
1414

15-
```
16-
$ npm-run-all clean lint build:*
17-
```
15+
## ⤴️ Motivation
1816

19-
```
20-
$ npm-run-all --parallel watch:*
21-
```
17+
- **Simplify.** The official `npm run-script` command cannot run multiple scripts, so if we want to run multiple scripts, it's redundant a bit. Let's shorten it by glob-like patterns.<br>
18+
Before: `npm run clean && npm run build:css && npm run build:js && npm run build:html`<br>
19+
After: `npm-run-all clean build:*`
20+
- **Cross platform.** We sometimes use `&` to run multiple command in parallel, but `cmd.exe` (`npm run-script` uses it by default) does not support the `&`. Half of Node.js users is using it on Windows, so the use of `&` might block contributions. `npm-run-all --parallel` works well on Windows as well.
2221

23-
## Installation
22+
## 💿 Installation
2423

2524
```bash
2625
$ npm install npm-run-all --save-dev
@@ -29,9 +28,10 @@ $ yarn add npm-run-all --dev
2928
```
3029

3130
- It requires `Node@>=4`.
32-
- The `npm-run-all` package introduces 3 CLI commands: `npm-run-all`, `run-s`, and `run-p`.
3331

34-
## CLI Commands
32+
## 📖 Usage
33+
34+
### CLI Commands
3535

3636
This `npm-run-all` package provides 3 CLI commands.
3737

@@ -46,22 +46,23 @@ Both [run-s] and [run-p] are shorthand commands.
4646
[run-s] is for sequential, [run-p] is for parallel.
4747
We can make simple plans with those commands.
4848

49-
### Yarn Compatibility
49+
#### Yarn Compatibility
50+
51+
If a script is invoked with Yarn, `npm-run-all` will correctly use Yarn to execute the plan's child scripts.
5052

51-
If a script is invoked with Yarn, npm-run-all will correctly use Yarn to execute the plan's child scripts.
52-
## Node API
53+
### Node API
5354

5455
This `npm-run-all` package provides Node API.
5556

5657
- [Node API]
5758

58-
## Changelog
59+
## 📰 Changelog
5960

6061
- https://github.com/mysticatea/npm-run-all/releases
6162

62-
## Contributing
63+
## 🍻 Contributing
6364

64-
Thank you for contributing!
65+
Welcome♡
6566

6667
### Bug Reports or Feature Requests
6768

@@ -73,18 +74,16 @@ Please use GitHub Pull Requests.
7374

7475
I'm not familiar with English, so I especially thank you for documents' corrections.
7576

76-
### Feature Implementing
77+
### Implementing
7778

7879
Please use GitHub Pull Requests.
7980

8081
There are some npm-scripts to help developments.
81-
Those work on Windows, Mac, or Linux (by the way, I'm developping `npm-run-all` on Windows).
8282

8383
- **npm test** - Run tests and collect coverage.
84-
- **npm run build** - Make `lib` directory from `src` directory.
85-
- **npm run clean** - Delete directories (folders) which are created by other commands.
84+
- **npm run clean** - Delete temporary files.
8685
- **npm run lint** - Run ESLint.
87-
- **npm run watch** - Run tests (not collect coverage) when each file was modified.
86+
- **npm run watch** - Run tests (not collect coverage) on every file change.
8887

8988
[npm-run-all]: docs/npm-run-all.md
9089
[run-s]: docs/run-s.md

docs/node-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
A Node module to run given npm-scripts in parallel or sequential.
77

8-
```
8+
```js
99
const runAll = require("npm-run-all");
1010

1111
runAll(["clean", "lint", "build:*"], {parallel: false})

docs/npm-run-all.md

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,6 @@
33

44
# `npm-run-all` command
55

6-
A CLI command to run given npm-scripts in parallel or sequential.
7-
8-
```
9-
> npm-run-all clean lint build:*
10-
11-
> npm-run-all --parallel watch:*
12-
```
13-
14-
## Installation
15-
16-
```
17-
> npm install -g npm-run-all
18-
```
19-
20-
- Requires `Node@>=0.10` and `npm@>=2`
21-
- The `npm-run-all` package introduces 3 CLI commands: `npm-run-all`, `run-s`, and `run-p`.
22-
23-
## Usage
24-
256
```
267
Usage:
278
$ npm-run-all [--help | -h | --version | -v]
@@ -88,7 +69,7 @@ On the other hand, this `npm-run-all` command runs multiple scripts in parallel
8869
### Run scripts sequentially
8970

9071
```
91-
npm-run-all clean lint build
72+
$ npm-run-all clean lint build
9273
```
9374

9475
This is same as `npm run clean && npm run lint && npm run build`.
@@ -99,7 +80,7 @@ If `--continue-on-error` option is given, this behavior will be disabled.
9980
### Run scripts in parallel
10081

10182
```
102-
npm-run-all --parallel lint build
83+
$ npm-run-all --parallel lint build
10384
```
10485

10586
This is similar to `npm run lint & npm run build`.
@@ -112,19 +93,19 @@ If `--continue-on-error` option is given, this behavior will be disabled.
11293
### Run a mix of sequential and parallel scripts
11394

11495
```
115-
npm-run-all clean lint --parallel watch:html watch:js
96+
$ npm-run-all clean lint --parallel watch:html watch:js
11697
```
11798

11899
1. First, this runs `clean` and `lint` sequentially / serially.
119100
2. Next, runs `watch:html` and `watch:js` in parallel.
120101

121102
```
122-
npm-run-all a b --parallel c d --sequential e f --parallel g h i
103+
$ npm-run-all a b --parallel c d --sequential e f --parallel g h i
123104
```
124105
or
125106

126107
```
127-
npm-run-all a b --parallel c d --serial e f --parallel g h i
108+
$ npm-run-all a b --parallel c d --serial e f --parallel g h i
128109
```
129110

130111
1. First, runs `a` and `b` sequentially / serially.
@@ -138,14 +119,14 @@ We can use [glob]-like patterns to specify npm-scripts.
138119
The difference is one -- the separator is `:` instead of `/`.
139120

140121
```
141-
> npm-run-all --parallel watch:*
122+
$ npm-run-all --parallel watch:*
142123
```
143124

144125
In this case, runs sub scripts of `watch`. For example: `watch:html`, `watch:js`.
145126
But, doesn't run sub-sub scripts. For example: `watch:js:index`.
146127

147128
```
148-
> npm-run-all --parallel watch:**
129+
$ npm-run-all --parallel watch:**
149130
```
150131

151132
If we use a globstar `**`, runs both sub scripts and sub-sub scripts.
@@ -158,8 +139,8 @@ We can enclose a script name or a pattern in quotes to use arguments.
158139
The following 2 commands are similar.
159140

160141
```
161-
> npm-run-all --parallel "build:* -- --watch"
162-
> npm run build:aaa -- --watch & npm run build:bbb -- --watch
142+
$ npm-run-all --parallel "build:* -- --watch"
143+
$ npm run build:aaa -- --watch & npm run build:bbb -- --watch
163144
```
164145

165146
When we use a pattern, arguments are forwarded to every matched script.
@@ -169,7 +150,7 @@ When we use a pattern, arguments are forwarded to every matched script.
169150
We can use placeholders to give the arguments preceded by `--` to scripts.
170151

171152
```
172-
> npm-run-all build "start-server -- --port {1}" -- 8080
153+
$ npm-run-all build "start-server -- --port {1}" -- 8080
173154
```
174155

175156
This is useful to pass through arguments from `npm run` command.
@@ -183,7 +164,7 @@ This is useful to pass through arguments from `npm run` command.
183164
```
184165

185166
```
186-
> npm run start 8080
167+
$ npm run start 8080
187168
188169
> example@0.0.0 start /path/to/package.json
189170
> npm-run-all build "start-server -- --port {1}" -- "8080"

docs/run-p.md

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,6 @@
66
A CLI command to run given npm-scripts in parallel.
77
This command is the shorthand of `npm-run-all -p`.
88

9-
```
10-
> run-p watch:*
11-
```
12-
13-
## Installation
14-
15-
```
16-
> npm install -g npm-run-all
17-
```
18-
19-
- Requires `Node@>=0.10` and `npm@>=2`
20-
- The `npm-run-all` package introduces 3 CLI commands: `npm-run-all`, `run-s`, and `run-p`.
21-
22-
## Usage
23-
249
```
2510
Usage:
2611
$ run-p [--help | -h | --version | -v]
@@ -85,8 +70,8 @@ The following 2 commands are similar.
8570
The `run-p` command is shorter and **available on Windows**.
8671

8772
```
88-
> run-p lint build
89-
> npm run lint & npm run build
73+
$ run-p lint build
74+
$ npm run lint & npm run build
9075
```
9176

9277
**Note1:** If a script exited with a non-zero code, the other scripts and those descendant processes are killed with `SIGTERM` (On Windows, with `taskkill.exe /F /T`).
@@ -100,14 +85,14 @@ We can use [glob]-like patterns to specify npm-scripts.
10085
The difference is one -- the separator is `:` instead of `/`.
10186

10287
```
103-
> run-p watch:*
88+
$ run-p watch:*
10489
```
10590

10691
In this case, runs sub scripts of `watch`. For example: `watch:html`, `watch:js`.
10792
But, doesn't run sub-sub scripts. For example: `watch:js:index`.
10893

10994
```
110-
> run-p watch:**
95+
$ run-p watch:**
11196
```
11297

11398
If we use a globstar `**`, runs both sub scripts and sub-sub scripts.
@@ -120,8 +105,8 @@ We can enclose a script name or a pattern in quotes to use arguments.
120105
The following 2 commands are similar.
121106

122107
```
123-
> run-p "build:* -- --watch"
124-
> npm run build:aaa -- --watch & npm run build:bbb -- --watch
108+
$ run-p "build:* -- --watch"
109+
$ npm run build:aaa -- --watch & npm run build:bbb -- --watch
125110
```
126111

127112
When we use a pattern, arguments are forwarded to every matched script.
@@ -131,7 +116,7 @@ When we use a pattern, arguments are forwarded to every matched script.
131116
We can use placeholders to give the arguments preceded by `--` to scripts.
132117

133118
```
134-
> run-p "start-server -- --port {1}" -- 8080
119+
$ run-p "start-server -- --port {1}" -- 8080
135120
```
136121

137122
This is useful to pass through arguments from `npm run` command.
@@ -145,7 +130,7 @@ This is useful to pass through arguments from `npm run` command.
145130
```
146131

147132
```
148-
> npm run start 8080
133+
$ npm run start 8080
149134
150135
> example@0.0.0 start /path/to/package.json
151136
> run-p "start-server -- --port {1}" -- "8080"

docs/run-s.md

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,6 @@
66
A CLI command to run given npm-scripts sequentially.
77
This command is the shorthand of `npm-run-all -s`.
88

9-
```
10-
> run-s lint build:* test
11-
```
12-
13-
## Installation
14-
15-
```
16-
> npm install -g npm-run-all
17-
```
18-
19-
- Requires `Node@>=0.10` and `npm@>=2`
20-
- The `npm-run-all` package introduces 3 CLI commands: `npm-run-all`, `run-s`, and `run-p`.
21-
22-
## Usage
23-
249
```
2510
Usage:
2611
$ run-s [--help | -h | --version | -v]
@@ -79,8 +64,8 @@ The following 2 commands are the same.
7964
The `run-s` command is shorter.
8065

8166
```
82-
> run-s clean lint build
83-
> npm run clean && npm run lint && npm run build
67+
$ run-s clean lint build
68+
$ npm run clean && npm run lint && npm run build
8469
```
8570

8671
**Note:** If a script exited with a non-zero code, the following scripts are not run.
@@ -91,14 +76,14 @@ We can use [glob]-like patterns to specify npm-scripts.
9176
The difference is one -- the separator is `:` instead of `/`.
9277

9378
```
94-
> run-s build:*
79+
$ run-s build:*
9580
```
9681

9782
In this case, runs sub scripts of `build`. For example: `build:html`, `build:js`.
9883
But, doesn't run sub-sub scripts. For example: `build:js:index`.
9984

10085
```
101-
> run-s build:**
86+
$ run-s build:**
10287
```
10388

10489
If we use a globstar `**`, runs both sub scripts and sub-sub scripts.
@@ -111,8 +96,8 @@ We can enclose a script name or a pattern in quotes to use arguments.
11196
The following 2 commands are the same.
11297

11398
```
114-
> run-s start:server "delay 3000" start:client
115-
> npm run start:server && npm run delay 3000 && npm run start:client
99+
$ run-s start:server "delay 3000" start:client
100+
$ npm run start:server && npm run delay 3000 && npm run start:client
116101
```
117102

118103
When we use a pattern, arguments are forwarded to every matched script.
@@ -122,7 +107,7 @@ When we use a pattern, arguments are forwarded to every matched script.
122107
We can use placeholders to give the arguments preceded by `--` to scripts.
123108

124109
```
125-
> run-s build "start-server -- --port {1}" -- 8080
110+
$ run-s build "start-server -- --port {1}" -- 8080
126111
```
127112

128113
This is useful to pass through arguments from `npm run` command.
@@ -136,7 +121,7 @@ This is useful to pass through arguments from `npm run` command.
136121
```
137122

138123
```
139-
> npm run start 8080
124+
$ npm run start 8080
140125
141126
> example@0.0.0 start /path/to/package.json
142127
> run-s build "start-server -- --port {1}" -- "8080"

0 commit comments

Comments
 (0)