Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/reggi/pkgrun
:runner: Run multiple package.json scripts with one command.
https://github.com/reggi/pkgrun
Last synced: about 1 month ago
JSON representation
:runner: Run multiple package.json scripts with one command.
- Host: GitHub
- URL: https://github.com/reggi/pkgrun
- Owner: reggi
- License: mit
- Created: 2015-08-13T20:15:37.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-08-13T23:03:21.000Z (over 9 years ago)
- Last Synced: 2024-10-05T10:47:44.846Z (about 2 months ago)
- Language: JavaScript
- Size: 117 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `pkgrun`
Run multiple `package.json` scripts with one command. `pkgrun` allows you to select scripts to run in `package.json` with a `glob` pattern. Basically `npm run` with glob support!
Turn this:
```bash
npm run soup-clam && npm run soup-cream && npm run soup-mushroom
```Into this:
```bash
pkgrun 'soup-*'
```Normally you want to have each command in it's own line, tucked away with it's own property, and you want to use `&&` to concat multiple operations together. This can get really messy really fast.
```json
{
"soup": "npm run soup-clam && soup-cream && soup-mushroom",
"soup-clam": "echo 'clam soup'",
"soup-cream": "echo 'cream soup'",
"soup-mushroom": "echo 'cream mushroom'"
}
```Now you can just write:
```json
{
"soup": "pkgrun 'soup*'",
"soup-clam": "echo 'clam soup'",
"soup-cream": "echo 'cream soup'",
"soup-mushroom": "echo 'cream mushroom'"
}
```The command `pkgrun 'soup*'` will go into your `package.json` and pull all of the scripts starting with `soup` (in the order they are in) and execute them one by one.
## Glob Reminder
Most shells use glob patterns to select files and send the matched files to a command. If you have a file `soup-file.js` in your working directory then `pkgrun soup*` (note that the argument is not in quotes) will return `No package script match found: soup-file.js`. If theres a glob pattern in the argument should encapsulated in quotes.