@intermatter/envelope
v1.1.7
Published
NPM package to enable cross-platform workflows with environment variables.
Downloads
40
Readme
Envelope
NPM package to enable cross-platform workflows with environment variables.
Installation
npm -i @intermatter/envelope
Usage
envelope RELATIVE_PATH/ENVIRONMENT_NAME 'COMMAND'
RELATIVE_PATH: specifies the location of the .env.ENVIRONMENT_NAME file relative to the package's root directory. If the dotenv file is located in the root directory, then ./
or NULL is used for RELATIVE_PATH.
ENVIRONMENT_NAME: myEnvironmentFile
will set the file .env.myEnvironmentFile
in the root of the package as the source of environment variables applied to the enclosed script.
COMMAND: Any npm-compatible or os-compatible command
##Example:
scripts:
{
"some:test": "envelope ../development 'echo $FOO_BAR'"
}
Notice
- If using double qoutes to enclose the command, it is necessary to manually escape the quotes and double escape
$
character. - Using the absolute path for the environment file is not supported.
scripts:
{
"some:test": "envelope development \"echo \\$FOO_BAR\""
}
Motivation
There is a number of cross-platform, portability and usability issues with other NPM packages that are designed to achieve similar functionality.