← Back
enviroment npm

Run script commands with enviroment variables

If you need to run a command with a bunch of variables, or want those variables to change depending enviroment, I've recently discovered env-cmd that takes the values from .env file and injects them before running the command.

Usage:

"scripts": {
"env-cmd node server.js"
}

Source: https://github.com/toddbluhm/env-cmd