from-env is helper script that makes environment variables from a local .env
-file inside command line statements available.
npm install --save-dev from-env
.env
VARIABLE1=needs
VARIABLE2=have
VARIABLE3=variables
package.json
(before)
{
"scripts": {
"yo": "your-command --that needs --to have --some variables"
}
}
package.json
(after)
{
"scripts": {
"yo": "from-env your-command --that %VARIABLE1 --to %VARIABLE2 --some %VARIABLE3"
}
}