包详细信息

redrun

coderaiser2.8kMIT12.0.0

CLI tool to run multiple npm-scripts fast

redrun, scripts, package, npm

自述文件

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

更新日志

2025.03.22, v12.0.0

feature:

  • 3e4b3e0 redrun: eslint-plugin-putout v26.0.2
  • 8f27dc9 redrun: putout v39.0.2
  • f936fd3 redrun: madrun v11.0.0
  • dcf4c45 redrun: drop support of node < 20

2025.02.18, v11.1.0

feature:

  • 2add89f redrun: add ability to run scripts when node_modules installed upper in directory tree

2025.02.12, v11.0.7

feature:

  • b35e422 redrun: eslint-plugin-putout v24.0.3
  • cac2c43 redrun: putout v38.1.2
  • fa7291e redrun: envir v3.0.1

2025.01.09, v11.0.6

feature:

  • 48d3de2 redrun: eslint-plugin-n v17.15.1
  • a7c373e redrun: eslint v9.17.0
  • 54326f9 redrun: c8 v10.1.3
  • 0f6af06 redrun: eslint-plugin-putout v23.4.0
  • 55ae750 redrun: putout v37.12.0

2024.03.19, v11.0.5

fix:

  • cd6711b redrun: mjs -> js

2024.03.19, v11.0.4

feature:

  • aa0f963 redrun: coupole npm -s

2024.03.19, v11.0.3

fix:

  • 69e90f3 redrun: c8: dependencies -> devDependencies

2024.03.19, v11.0.2

feature:

  • 34ab881 convert to ESM
  • b4ba7c2 redrun: add support of npm run -s
  • b1a6fca redrun: string-replace-async v3.0.2

2024.02.01, v11.0.1

feature:

  • 5a6bef8 redrun: supertape v10.0.0
  • 5fc0b7c redrun: madrun v10.0.1
  • ff23fa9 redrun: putout v35.0.3
  • 25d19df redrun: c8 v9.1.0

2023.12.12, v11.0.0

feature:

  • 0333f52 redrun: drop support of node < 18
  • f35f965 redrun: madrun v10.0.0
  • 5a4235a redrun: parent-directories v3.0.0
  • e7ce372 redrun: eslint-plugin-putout v22.1.0
  • 49f7bde redrun: putout v34.0.8
  • 032c7d9 redrun: supertape v9.0.0

2023.08.13, v10.2.0

feature:

  • f7fca52 package: eslint-plugin-putout v19.0.4
  • 76072f4 package: putout v31.1.0
  • f8d95e3 redrun: exit with 1 when script not found

2023.07.12, v10.1.0

feature:

  • b5859d4 package: nodemon v3.0.1
  • dfaabe3 package: putout v30.3.1
  • 2c3a6a7 package: c8 v8.0.0
  • 75e21ee package: eslint-plugin-n v16.0.1
  • c1fa1d9 package: eslint-plugin-putout v18.1.0
  • 622bec9 package: putout v29.0.2
  • 89098e5 package: supertape v8.3.0
  • c7e8655 package: eslint-plugin-putout v16.2.1
  • 4b5a544 package: putout v27.7.0

2022.08.06, v10.0.2

feature:

  • (package) eslint-plugin-n v15.2.4
  • (package) coveralls v3.1.1
  • (package) madrun v9.0.6
  • (package) eslint-plugin-putout v16.0.1
  • (package) supertape v7.6.0
  • (package) yargs-parser v21.1.1
  • (package) putout v27.0.1
  • (package) eslint v8.21.0
  • (package) eslint-plugin-putout v15.1.1

2022.04.06, v10.0.1

fix:

  • (redrun) engines

feature:

  • (package) eslint-plugin-putout v14.8.0

2022.02.17, v10.0.0

feature:

  • (package) supertape v7.0.1
  • (package) putout v25.0.0
  • (package) madrun v9.0.0
  • (package) yargs-parser v21.0.0
  • (package) putout v24.1.0
  • (package) eslint-plugin-putout v13.0.1
  • (package) eslint-plugin-putout v11.6.0
  • (package) putout v22.0.0
  • (package) eslint v8.0.0-beta.1
  • (package) eslint-plugin-putout v9.3.0
  • (package) putout v19.7.1
  • (package) supertape v6.1.0

2021.05.09, v9.0.1

feature:

  • (package) supertape v5.4.0
  • (package) putout v17.1.0
  • (package) parent-dirs v2.0.0
  • (package) putout v15.1.1
  • (package) eslint-plugin-putout v7.1.1
  • (package) putout v14.1.3
  • (package) supertape v4.6.0
  • (package) putout v13.3.0
  • (package) putout v12.1.0
  • (package) supertape v3.7.3

2020.11.27, v9.0.0

feature:

  • (package) madrun v8.0.0
  • (redrun) asyncify
  • (package) eslint-plugin-putout v6.1.0
  • (package) putout v11.0.5

2020.09.11, v8.0.3

feature:

  • (package) yargs-parser v20.0.0

2020.08.10, v8.0.2

fix:

  • (redrun) replace: madrun: rm useless code

feature:

  • (package) yargs-parser v19.0.1

2020.06.26, v8.0.1

feature:

  • (package) putout v9.1.0
  • (package) supertape v2.0.1
  • (package) eslint v7.3.1
  • (package) eslint-plugin-putout v5.0.1
  • (package) @cloudcmd/stub v3.1.0
  • (package) madrun v7.0.0

2020.05.04, v8.0.0

feature:

  • (package) madrun v6.0.0
  • (package) eslint-plugin-putout v4.0.0
  • (package) putout v8.0.0
  • (redrun) drop support of node < 10

2020.03.25, v7.1.20

feature:

  • (package) fullstore v3.0.0

2020.03.08, v7.1.19

feature:

  • (package) yargs-parser v18.1.0
  • (package) readjson v2.0.1

2020.02.24, v7.1.18

feature:

  • (package) try-catch v3.0.0

2020.02.10, v7.1.17

feature:

  • (package) yargs-parser v17.0.0
  • (package) eslint-plugin-node v11.0.0
  • (package) nyc v15.0.0

2019.12.21, v7.1.16

feature:

  • (package) for-each-key v2.0.0

2019.12.21, v7.1.15

feature:

  • (package) rm unused jessy

2019.11.21, v7.1.14

feature:

  • (package) envir v2.0.0

2019.11.21, v7.1.13

feature:

  • (package) rm unused all-object-keys
  • (package) nodemon v2.0.0

2019.11.06, v7.1.12

feature:

  • (package) putout v7.0.0
  • (package) eslint-plugin-putout v3.0.0
  • (package) madrun v5.0.0

2019.10.27, v7.1.11

feature:

  • (package) yargs-parser v16.0.0

2019.10.25, v7.1.10

feature:

  • (package) madrun v4.0.0

2019.10.07, v7.1.9

feature:

  • (package) putout v6.12.1
  • (package) yargs-parser v15.0.0
  • (package) currify v4.0.0

2019.09.12, v7.1.8

feature:

  • (package) somefilter v3.0.0
  • (package) fullstore v2.0.2

2019.09.07, v7.1.7

feature:

  • (package) yargs-parser v14.0.0
  • (package) eslint-plugin-node v10.0.0

2019.08.30, v7.1.6

feature:

  • (package) madrun v3.0.1
  • (package) putout v5.10.2
  • (package) eslint-plugin-putout v2.0.0
  • (package) eslint v6.1.0
  • (package) eslint-plugin-node v9.0.1
  • (package) nyc v14.1.1
  • (package) putout v4.2.2

2019.02.15, v7.1.5

feature:

  • (package) madrun v2.0.0

2019.02.04, v7.1.4

feature:

  • (package) yargs-parser v13.0.0

2019.02.01, v7.1.3

fix:

  • (redrun) madrun.js support

2019.02.01, v7.1.2

feature:

  • (package) yargs-parser v12.0.0

2019.01.25, v7.1.1

fix:

  • (replace) rm unused

2019.01.25, v7.1.0

feature:

  • (redrun) add support of madrun

2018.11.12, v7.0.3

feature:

  • (package) eslint-plugin-node v8.0.0
  • (package) yargs-parser v11.1.0

2018.10.09, v7.0.2

fix:

  • (package) back to working yargs-parser v10
  • (redrun) rm console.log

2018.10.09, v7.0.1

feature:

  • (package) currify v3.0.0

2018.09.27, v7.0.0

feature:

  • (package) debug v4.0.1
  • (redrun) drop support of node < 8

2018.09.24, v6.0.7

feature:

  • (package) squad v3.0.0
  • (package) nyc v13.0.1
  • (package) add eslint-plugin-node
  • (package) eslint v5.1.0

2018.06.07, v6.0.6

feature:

  • (package) debug v3.1.0: regular expression ddos

2018.06.04, v6.0.5

fix:

  • (redrun) one-line infinite loop detect

feature:

  • (package) nyc v12.0.2

2018.04.18, v6.0.4

fix:

  • (quote-args) do not add quotes when there is one of different type

2018.04.17, v6.0.3

fix:

  • (redrun) parse: quotes after --

2018.04.05, v6.0.2

feature:

  • (package) yargs-parser v10.0.0
  • (package) for-each-key

2018.03.09, v6.0.1

fix:

  • (redrun) infinite -> Infinite

2018.03.07, v6.0.0

feature:

  • (redrun) drop support of node < 4, legacy
  • (redrun) add ability to determine infinite loop

2018.02.22, v5.10.5

fix:

  • (redrun) somefilter: node v4 support

2018.02.22, v5.10.4

fix:

  • (redrun) npm run script not found: null -> not found

feature:

  • (package) somefilter v2.0.0

2018.02.16, v5.10.3

feature:

  • (package) squad v2.0.0

2018.02.08, v5.10.2

fix:

  • (package) babel-preset-env: dependencies -> devDependencies

2018.02.08, v5.10.1

feature:

  • (package) yargs-parser v9.0.2
  • (package) babel-preset-env v1.6.1
  • (package) try-catch v2.0.0

2017.11.08, v5.10.0

feature:

  • (redrun) add support of npx (#8)

2017.10.05, v5.9.18

feature:

  • (package) yargs-parser v8.0.0
  • (package) coveralls v3.0.0

2017.09.01, v5.9.17

feature:

  • (package) env -> envir

2017.08.09, v5.9.16

feature:

  • (package) debug v3.0.0

2017.06.12, v5.9.15

fix:

  • (redrun) exit before all scripts done in mac os when curl used (#7)

feature:

  • (package) eslint v4.0.0
  • (package) scripts: prewisdom: rm package-lock.json
  • (package) nyc v11.0.1

2017.05.24, v5.9.14

fix:

  • (redrun) inner args
  • (env) no config

feature:

  • (get-body) rm unused code
  • (gitignore) add swp

2017.05.24, v5.9.13

feature:

  • (redrun) storage -> fullstore

2017.05.10, v5.9.12

feature:

  • (package) yargs-parser v7.0.0

2017.03.20, v5.9.11

fix:

  • (redrun) currify -> currify/legacy

2017.03.07, v5.9.10

fix:

  • (get-body) pre + post + symbols: regexp

feature:

  • (package) watch:lint

2017.02.21, v5.9.9

feature:

  • (package) includes -> indexOf
  • (travis) node: rm 4, 5

2017.02.20, v5.9.8

fix:

  • (package) array.includes in node <= 6

2017.02.20, v5.9.7

feature:

  • (package) yargs-parser v5.0.0

2017.02.01, v5.9.6

feature:

  • (redrun) Object.assign polyfill -> babel transform

2017.01.12, v5.9.5

feature:

  • (package) description
  • (package) npm-run-all v4.0.0
  • (package) nyc v10.0.0

2016.11.23, v5.9.4

feature:

  • (package) currify v2.0.0
  • (package) nyc v9.0.1

2016.11.02, v5.9.3

feature:

  • (package) jessy v2.0.0

2016.10.20, v5.9.2

fix:

  • (env) $npm_packageconfig: name with ""

2016.10.06, v5.9.1

fix:

  • (bin) redrun: bring back node v4.0 support

2016.10.04, v5.9.0

feature:

  • (redrun) add Object.assign polyfill for legacy node versions
  • (package) redrun-legacy -> redrun_

2016.09.28, v5.8.4

fix:

  • (redrun) mapsome -> mapsome/legacy

feature:

  • (redrun) includes -> indexOf: add support of old versions of node
  • (package) parent-dirs: put in bin/redrun.js: es2015 only

2016.09.28, v5.8.3

fix:

  • (redrun) drop every "--"
  • (redrun) "npm install" -> "null"

2016.09.26, v5.8.2

feature:

  • (package) yargs-parser v4.0.0

2016.09.20, v5.8.1

feature:

  • (quote-args) rm unused

2016.09.19, v5.8.0

feature:

  • (keys) keys -> all-object-keys
  • (redrun) improve arguments quots support in deep npm run
  • (eslint) rules: indent: 4

2016.09.16, v5.7.0

fix:

  • (redrun) prevent quotes duplication

feature:

  • (redrun) scripts args: quotes to word sequence -> quotes to every word

2016.09.09, v5.6.1

fix:

  • (redrun) args parsing: expand of inner redrun

2016.09.06, v5.6.0

feature:

  • (redrun) quote arguments after "--"

2016.09.06, v5.5.2

fix:

  • (package) redrun-completion-legacy
  • (redrun) support of scripts that contains "." in name

feature:

  • (package) add redrun-completion-legacy

2016.09.02, v5.5.1

feature:

  • (redrun-completion) add compdef support

2016.09.02, v5.5.0

feature:

  • (redrun) add redrun-completion: tab-completion of npm-scripts

2016.09.01, v5.4.0

feature:

  • (redrun) add $npm_package_version support
  • (package) npm-run-all v3.0.0

2016.08.15, v5.3.4

fix:

  • (env) globally installed modules first then node_modules/.bin -> node_modules/.bin and then global

feature:

  • (package) nyc v8.1.0

2016.08.12, v5.3.3

feature:

  • (package) yargs-parser v3.1.0
  • (package) add postpublish

2016.08.11, v5.3.2

fix:

  • (redrun) ignore empty deep scripts

2016.08.09, v5.3.1

feature:

  • (cli-parse) parseArgs: simplify aliases

2016.08.01, v5.3.0

feature:

  • (cli-parse) speed up: yargs -> yargs-parser

2016.07.27, v5.2.0

feature:

  • (cli-parse) put commands without --parallel, --series to begin

2016.07.26, v5.1.2

fix:

  • (redrun) crash when no scripts section in package.json

2016.07.19, v5.1.1

fix:

  • (redrun) {message} -> message

2016.07.19, v5.1.0

feature:

  • (redrun) add more information about json parsing errors
  • (package) nyc v7.0.0

2016.07.11, v5.0.1

fix:

  • (redrun) prevent built-in behaviour of "npm publish"
  • (redrun) prevent built-in behaviour of "npm version"

2016.07.08, v5.0.0

feature:

  • (redrun) --parallel, --series --: add params to every script, not only to last

2016.07.08, v4.2.1

fix:

  • chore(test) fixlint
  • feature(package) add fixlint
  • (redrun) parsing unrecognized option from package.json

feature:

  • (redrun) let -> const
  • (package) add fixlint
  • (jscs) add validateQuoteMarks, requireSemicolons

2016.07.06, v4.2.0

feature:

  • (redrun) add support of node.js < 4 with
  • (redrun) let -> const
  • (redrun) getEnv: traverseForInfo -> Info

2016.07.05, v4.1.1

fix:

  • (redrun) mapsome path

2016.07.05, v4.1.0

feature:

  • (redrun) rm deprecation message
  • (redrun) add ability to run scripts with redrun from any directory
  • (package) eslint v3.0.0
  • (package) add tap-min
  • (redrun) add -q, --quiet

2016.06.22, v4.0.0

feature:

  • (package) add tap-min
  • (redrun) add -q, --quiet

2016.05.16, v3.0.1

fix:

  • (redrun) -v, -h when no package.json in curren directory

feature:

  • (package) npm-run-all v2.0.0
  • (package) keywords: add
  • (package) scripts: rm "-"

2016.05.06, v3.0.0

fix:

  • (redrun) parse redrun args with ENV set

feature:

  • (redrun) add --calm, --series-calm, --parallel-calm
  • (cli-parse) help: add args

2016.05.05, v2.1.0

fix:

  • (cli-parse) script-not-found: message
  • (redrun) throw on similar name

feature:

  • (redrun) add script arguments support
  • (redrun) add tryOrExit
  • (redrun) preserve colors: spawnify -> child_process.execSync

2016.05.04, v2.0.0

feature:

  • (redrun) add support of "&&"

2016.05.04, v1.12.0

fix:

  • (regexp) (un?)install -> (un)?install

feature:

  • (redrun) add support of multylevel $npm_package_config variables

2016.04.29, v1.11.1

feature:

  • (package) rm npcp

2016.04.29, v1.11.0

feature:

  • (redrun) add npm_package_config support

2016.04.28, v1.10.1

fix:

  • (redrun) env: child process has no parent env

feature:

  • (redrun) preserve colors

2016.04.28, v1.10.0

feature:

  • (redrun) add $npm_package_config support

2016.04.27, v1.9.1

fix:

  • (redrun) parse names with "-"

2016.04.27, v1.9.0

feature:

  • (redrun) add node_modules/.bin to env PATH
  • (package) lint: rm --parallel

2016.04.27, v1.8.3

fix:

  • (redrun) names with "."

2016.04.27, v1.8.2

fix:

  • (redrun) --loud: undefined
  • (regexp) redrunName, scriptName: ":"

2016.04.27, v1.8.1

fix:

  • (redrun) wildcards support in inner parse

2016.04.27, v1.8.0

feature:

  • (redrun) add self-parsing

2016.04.27, v1.7.1

fix:

  • (redrun) cli-parse: no args: no script found -> help

feature:

  • (travis) add node v6

2016.04.26, v1.7.0

feature:

  • (redrun) add cli-parse
  • (redrun) cli-parse -> group-parse
  • (redrun) add regexp
  • (redrun) regexp -> wildcard

2016.04.23, v1.6.0

feature:

  • (redrun) add t, tst support
  • (redrun) add ai

2016.04.23, v1.5.0

feature:

  • (redrun) scripts:{} -> {}

2016.04.22, v1.4.1

feature:

  • (redrun) add node 4 support

2016.04.22, v1.4.0

feature:

  • (redrun) loud: "redrun: cmd" -> "cmd"
  • (package) lint -> slowlint

2016.04.22, v1.3.0

feature:

  • (redrun) add support of reserved script names (like "npm test")
  • (package) add watch:test/coverage
  • (cli-parse) add

2016.04.22, v1.2.1

feature:

  • (redrun) script1 script2 -> tasks

2016.04.22, v1.2.0

fix:

  • (redrun) process.stderr -> console.error

feature:

  • (redrun) add logo
  • (redurn) add -l, --loud
  • (redrun) add parallel, series

2016.04.21, v1.1.4

feature:

  • (redrun) series: rm console.log

2016.04.21, v1.1.3

fix:

  • (redrun) array

2016.04.21, v1.1.2

fix:

  • (redrun) seriesScripts

2016.04.21, v1.1.1

fix:

  • (redrun) series, parallel

2016.04.21, v1.1.0

fix:

  • (travis) codestyle -> lint

feature:

  • (package) add multi args support
  • (package) add coveralls