run-scoped
v0.1.6
Published
## Motivation
Downloads
2
Readme
Run Scoped
Motivation
Avoid duplicating scripts in a monorepo
Manage your scripts in a centralized way using run-scoped
Description
Run arbitrary script from package.json
in any sub-directory or package
* See how to set up a monorepo using lerna here
Options
rs [--scope packageNameGlob="*"] [--prefix pathToPackages="packages"]
Usage
Example Setup
package.json
{
"scripts": {
"prelog:env": "cross-env FOO=prelog printenv FOO",
"log:env": "cross-env FOO=log printenv FOO",
"postlog:env": "cross-env FOO=postlog printenv FOO"
}
}
packages
packages
├── common
└── greet
Using run-scoped
rs log --scope greet
Outputs
path-your-project/packages/greet
cross-env FOO=prelog printenv FOO
prelog
path-your-project/packages/greet
cross-env FOO=log printenv FOO
log
path-your-project/packages/greet
cross-env FOO=postlog printenv FOO
postlog