@philgs/spawn
v1.0.0
Published
Launch a script into a separate process with custom environment variables
Readme
Spawn
Launch a script into a separate process with custom environment variables
Usage
Define your custom environment variables in <app-root>/config/config.json using this format:
{
"data": {
"NODE_ENV": "development"
}
}You can supply an alternate path to the configuration file with the -c or --config command line flag (relative paths are resolved by using the current application directory (detected by looking for a node_modules subdirectory) as a base):
spawn -c ../some/other/config.jsonThen use spawn in the "scripts" section of your package.json, like so:
{
"scripts": {
"start": "spawn nodemon ./scripts/launch-dev-server.js --exec babel-node",
"test": "spawn mocha"
}
}Prior Art
This script is derived from a similar script. I would like to credit the original author(s), but I have lost all references to the original! (It may be a script that is generated by the Express app generator.)
License
The content of this repository is licensed under the 3-Clause BSD license. Please see the enclosed license file for specific terms.
