Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1
🏎 CLI tool to run multiple npm-scripts in a madly comfortable way
License
coderaiser/madrun
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
CLI tool to run multiple npm-scripts in a madly comfortable way. Can be used together withredrun.
npm i madrun -gFirst thing you should do is:
- ✅ create
.madrun.jsfile with all scripts written inJavaScript; - ✅ update
package.jsonscripts to usemadrun;
This can be done using:
madrun --init
When you create new script, you can run it with:madrun lint test.Runmadrun --init again, to updatepackage.json, so you can use:
npm run lintnpmtestThen you can runmadrun without args to see list of a scripts. Or run:
madrun <script>To run specified script.
You can enable tab-completion of npm scripts similar tonpm's completion using:
madrun-completion>>~/.bashrcmadrun-completion>>~/.zshrc
You may also pipe the output of madrun-completion to a file such as/usr/local/etc/bash_completion.d/madrun if you have a system that will read that file for you.
Madrun can be configured usingenv variables.
MADRUN_PWD will output current directory path:
MADRUN_PWD=1 madrun lint> putout libtest .madrun.js (/home/coderaiser/cloudcmd)
MADRUN_NAME will output name of current directory:
MADRUN_NAME=1 madrun lint> putout libtest .madrun.js (cloudcmd)
madrun supports nextAPI set:
Run script by a name or regexp.
name- name of a scriptopt- options to run withenv- object withenvvariablesscripts- all scripts set (need for embedding only)
Run scripts by a name or regexp one-by-one.
name- array of names of scripsopt- options to run withenv- object withenvvariablesscripts- all scripts set (need for embedding only)
Run scripts by a name or regexp parallel.
name- array of names of scripsopt- options to run withenv- object withenvvariablesscripts- all scripts set (need for embedding only)
Same asrun, but returns result withoutenv.
name- name of a scriptopt- options to run withenv- object withenvvariablesscripts- all scripts set (need for embedding only)
Let's installmadrun and save it asdevDependency with:
npm i madrun -D
Let's create file.madrun.js:
import{run,cutEnv}from'madrun';constenv={CI:1,};exportdefault{'lint':()=>'putout .','fix:lint':async()=>awaitrun('lint','--fix',{NODE_ENV:'development',}),'lint:env':()=>['putout .',{CI:1,}],'env:lint':()=>[env,'putout .'],'lint:no-env':async()=>awaitcutEnv('lint:env'),};
Now you can call any of listed scripts with help of 🏎Madrun:
madrun lint> putout.
Forseries run you can use:
madrun lint:*> CI=1 putout.&& putout.
- redrun - CLI tool to run multiple npm-scripts fast.
MIT
About
🏎 CLI tool to run multiple npm-scripts in a madly comfortable way
Topics
Resources
License
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.
