1.1.4 • Published 5 years ago

from-env v1.1.4

Weekly downloads
140
License
ISC
Repository
-
Last release
5 years ago

🕶 from-env 🕶

from-env is helper script that makes environment variables from a local .env-file inside command line statements available.

installation

npm install --save-dev from-env

usage

.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"
    }
}

alternative

this also works without any package (also on windows with wsl):

package.json

{
    "scripts": {
        "yo": "from-env your-command --that $(grep VARIABLE1 .env | cut -d '=' -f2) --to $(grep VARIABLE2 .env | cut -d '=' -f2) --some $(grep VARIABLE3 .env | cut -d '=' -f2)"
    }
}
1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.9

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago