Designed for use in monorepos where your devDependencies are installed in a parent directory to your individual packages.
Allows you run tools in node_modules/.bin
in the parent project (such
as the typescript compiler or mocha) without having to install them globally
or for each individual package.
For each individual package in your monorepo, add run-bin
as a devDependency
npm install --save-dev run-bin
Then simply add run-bin
to the start of your script definitions in
package.json
to allow them to utilise devDependencies installed at the
top-level of youe monorepo (or any node_modules folder above that!)
"scripts": {
"build": "run-bin tsc",
"test": "run-bin mocha"
}
This package also includes the functionality available in cross-env
so you
can also pass environment variables to your processes as shown below:
"scripts": {
"build": "run-bin NODE_ENV=production webpack",
}
Based on the awesome work by these fine folks:
MIT