open-index/open-npm huggingface dataset:
npm package: @philgs/spawn
Description: Launch a script into a separate process with custom environment variables
Author: Phil Gates-Shannon
Latest version: 1.0.0

# 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:

```json
{
    "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):

```bash
spawn -c ../some/other/config.json
```

Then use `spawn` in the "scripts" section of your `package.json`, like so:

```json
{
    "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][1]. Please see the [enclosed license file][2] for specific terms.

[1]: https://opensource.org/licenses/BSD-3-Clause
[2]: LICENSE.md