11.0.5 • Published 1 month ago

redrun v11.0.5

Weekly downloads
659
License
MIT
Repository
github
Last release
1 month ago

Redrun License NPM version Build Status Coverage Status

CLI tool to run multiple npm-scripts fast. Supports madly comfortable 🏎 Madrun.

Redrun

Install

npm i redrun -g

Usage

Usage: redrun [...tasks] [options] [-- ...args]
Options:
  -p, --parallel          run scripts in parallel
  -s, --series            run scripts in series
  -q, --quiet             do not output result command before execution
  -c, --calm              return zero exit code when command completed with error
  -P, --parallel-calm     run scripts in parallel and return zero exit code
  -S, --series-calm       run scripts in series and return zero exit code
  -h, --help              display this help and exit
  -v, --version           output version information and exit

Completion

You can enable tab-completion of npm scripts similar to npm's completion using:

redrun-completion >> ~/.bashrc
redrun-completion >> ~/.zshrc

You may also pipe the output of redrun-completion to a file such as /usr/local/etc/bash_completion.d/redrun if you have a system that will read that file for you.

How it works

package.json:

{
    "scripts": {
        "one": "npm run two",
        "two": "npm run three",
        "three": "echo 'hello'"
    }
}

Usually these expressions would be executed one after another:

coderaiser@cloudcmd:~/redrun$ npm run one

> redrun@1.0.0 one /home/coderaiser/redrun
> npm run two


> redrun@1.0.0 two /home/coderaiser/redrun
> npm run three


> redrun@1.0.0 three /home/coderaiser/redrun
> echo 'hello'

hello

All these npm run commands that are created are slow, because each time it creates a new process.

redrun makes it faster:

coderaiser@cloudcmd:~/redrun$ redrun one
> echo 'hello'
hello

How to use?

Redrun could be used via the command line, the scripts section of package.json or in a script:

import redrun from 'redrun';

await redrun('one', {
    one: 'npm run two',
    two: 'npm run three',
    three: `echo 'hello'`,
});

// returns
`echo 'hello'`;

await redrun('one', {
    one: 'redrun -p two three',
    two: 'redrun four five',
    three: `echo 'hello'`,
    four: 'jshint lib',
    five: 'jscs test',
});

// returns
`jshint lib && jscs test & echo 'hello'`;

Speed comparison

The less spend time is better:

  • npm-run-all: 1m12.570s
  • npm run && npm run: 1m10.727s
  • redrun: 0m38.312s

Here are logs:

npm-run-all:

coderaiser@cloudcmd:~/redrun$ time npm run speed:npm-run-all

> speed:npm-run-all /home/coderaiser/redrun
> npm-run-all lint:*


> redrun@5.3.0 lint:jshint /home/coderaiser/redrun
> jshint bin lib test


> redrun@5.3.0 lint:eslint-bin /home/coderaiser/redrun
> eslint --rule 'no-console:0' bin


> redrun@5.3.0 lint:eslint-lib /home/coderaiser/redrun
> eslint lib test


> redrun@5.3.0 lint:jscs /home/coderaiser/redrun
> jscs --esnext bin lib test


real    1m12.570s
user    0m14.431s
sys     0m17.147s

npm run && npm run

coderaiserser@cloudcmd:~/redrun$ time npm run speed:npm-run

redrun@5.3.0 speed:npm-run /home/coderaiser/redrun
> npm run lint:jshint && npm run lint:eslint-bin && npm run lint:eslint-lib && npm run lint:jscs


> redrun@5.3.0 lint:jshint /home/coderaiser/redrun
> jshint bin lib test


> redrun@5.3.0 lint:eslint-bin /home/coderaiser/redrun
> eslint --rule 'no-console:0' bin


> redrun@5.3.0 lint:eslint-lib /home/coderaiser/redrun
> eslint lib test


> redrun@5.3.0 lint:jscs /home/coderaiser/redrun
> jscs --esnext bin lib test


real    1m10.727s
user    0m14.670s
sys     0m16.663s

redrun

coderaiser@cloudcmd:~/redrun$ redrun lint:*
> jshint bin lib test && eslint --rule 'no-console:0' bin && eslint lib test && jscs --esnext bin lib test

real    0m38.312s
user    0m8.198s
sys     0m9.113s

As you can see redrun is much faster and more DRY way of using npm scripts than regular solutions.

Related

  • madrun - CLI tool to run multiple npm-scripts in a madly comfortable way.

License

MIT

11.0.4

1 month ago

11.0.5

1 month ago

11.0.2

1 month ago

11.0.3

1 month ago

11.0.1

3 months ago

11.0.0

5 months ago

10.2.0

9 months ago

10.1.0

10 months ago

10.0.2

2 years ago

10.0.1

2 years ago

10.0.0

2 years ago

9.0.1

3 years ago

9.0.0

3 years ago

8.0.3

4 years ago

8.0.2

4 years ago

8.0.1

4 years ago

8.0.0

4 years ago

7.1.20

4 years ago

7.1.19

4 years ago

7.1.18

4 years ago

7.1.17

4 years ago

7.1.16

4 years ago

7.1.15

4 years ago

7.1.14

4 years ago

7.1.13

4 years ago

7.1.12

4 years ago

7.1.11

5 years ago

7.1.10

5 years ago

7.1.9

5 years ago

7.1.8

5 years ago

7.1.7

5 years ago

7.1.6

5 years ago

7.1.5

5 years ago

7.1.4

5 years ago

7.1.3

5 years ago

7.1.2

5 years ago

7.1.1

5 years ago

7.1.0

5 years ago

7.0.3

5 years ago

7.0.2

6 years ago

7.0.1

6 years ago

7.0.0

6 years ago

6.0.7

6 years ago

6.0.6

6 years ago

6.0.5

6 years ago

6.0.4

6 years ago

6.0.3

6 years ago

6.0.2

6 years ago

6.0.1

6 years ago

6.0.0

6 years ago

5.10.5

6 years ago

5.10.4

6 years ago

5.10.3

6 years ago

5.10.2

6 years ago

5.10.1

6 years ago

5.10.0

6 years ago

5.9.18

7 years ago

5.9.17

7 years ago

5.9.16

7 years ago

5.9.15

7 years ago

5.9.14

7 years ago

5.9.13

7 years ago

5.9.12

7 years ago

5.9.11

7 years ago

5.9.10

7 years ago

5.9.9

7 years ago

5.9.8

7 years ago

5.9.7

7 years ago

5.9.6

7 years ago

5.9.5

7 years ago

5.9.4

7 years ago

5.9.3

8 years ago

5.9.2

8 years ago

5.9.1

8 years ago

5.9.0

8 years ago

5.8.4

8 years ago

5.8.3

8 years ago

5.8.2

8 years ago

5.8.1

8 years ago

5.8.0

8 years ago

5.7.0

8 years ago

5.6.1

8 years ago

5.6.0

8 years ago

5.5.1

8 years ago

5.5.0

8 years ago

5.4.0

8 years ago

5.3.4

8 years ago

5.3.3

8 years ago

5.3.2

8 years ago

5.3.1

8 years ago

5.3.0

8 years ago

5.2.0

8 years ago

5.1.2

8 years ago

5.1.1

8 years ago

5.1.0

8 years ago

5.0.1

8 years ago

5.0.0

8 years ago

4.2.1

8 years ago

4.2.0

8 years ago

4.1.1

8 years ago

4.1.0

8 years ago

4.0.0

8 years ago

3.0.1

8 years ago

3.0.0

8 years ago

2.1.0

8 years ago

2.0.0

8 years ago

1.12.0

8 years ago

1.11.1

8 years ago

1.11.0

8 years ago

1.10.1

8 years ago

1.10.0

8 years ago

1.9.1

8 years ago

1.9.0

8 years ago

1.8.3

8 years ago

1.8.2

8 years ago

1.8.1

8 years ago

1.8.0

8 years ago

1.7.1

8 years ago

1.7.0

8 years ago

1.6.0

8 years ago

1.5.0

8 years ago

1.4.1

8 years ago

1.4.0

8 years ago

1.3.0

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago