Inspired by scripty
npm install magic-carpet
- From your module's root, create a scripts directory
- If you want to define an npm script named "magic:command", write an executable file at scripts/magic/command.js
- Declare your "magic:command" script in "scripts" in your package.json:
- Run the magic:command
The runAndExit can be helpful when running simple shell commands one after the other.
const runAndExit = ;;
If for any reason you need to get the shell arguments passed to yarn and pass
them along to the apps you are calling then you can do that by using the
const runAndExit shellArguments = ;;
The utility npmCommand will get the full npm or yarn command name being invoked. This can be useful when printing help screens.
const runAndExit npmCommand = ;if processargv)console;process;;