Changelog
7.0.0
.env
file path resolving has been changed to allow for absolute pathing, relative pathing, and ~
home directory pathing. Please
see Readme.md for more info about how the new pathing conventions work.Changelog
6.0.0
.env
file behavior is no longer the default behavior. You must specify --fallback
option for that behavior now.>=4.0.0
. Note: the implied minimum version
before this release was always 4.0.0
, but now it is explicitly set and could produce warnings by npm if included in projects that utilizes a
node version that is less than 4.0.0
.--fallback
option to allow for falling back to the default .env
file if the provided .env
file is not found..env-cmdrc
file. The environments override each other like this:
development,production
where production
vars override development
vars if they share the same vars.env-cmd
no longer crashes when it cannot find the provided .env
file. Instead, it will execute as normal, but without included any custom env vars. Note: it will still include system and shell vars.Changelog
5.1.0
--no-override
that when passed will make it so that the env file
vars will not overwrite already defined env vars on process.env
or in the shellstandard >= 10.0.0
, sinon >= 2.0.0
Changelog
5.0.0
.env
files (full line comments are still allowed).env
file no longer supports the env var
format (only env=var
is allowed now)#
) in the value portion of an env var.env
and use that as a fallback. See README for why this is
helpful. (special thanks to Alexander Praetorius)Changelog
4.0.0
ENV1="value"
-> ENV1=""value""
(this only applies to double quotes, single quotes continue to work as normal)#
. Now, in order to use a #
in a env value, you have to surround that env value in double quotes: ENV="Some#Value"
..env-cmdrc
file that would not add system env vars back in after reading the .env-cmdrc
file. This meant that system vars like PATH
would not exist when running the command.Changelog
3.0.0
.env-cmdrc
file to hold multiple configs.js
file exporting an object for your env file (special thanks to Jon Scheiding!)cross-spawn
lib to 5.0.1Changelog
2.1.0
key value
mapping in env vars fileENV=VALUE # inline comment
-e/--env
flags that were not needed anymoreChangelog
2.0.0
-e
and --env
flags. Now it just expects the first arg to env-cmd
to be the relative path to the env file: env-cmd env_file command carg1 carg2
ParseEnvFile
is now more properly named ParseEnvString
ParseEnvString
will ignore comment lines (lines starting with #
)ParseEnvString
will ignore empty lines in env fileParseEnvString
will extract the last line even if no newline (\n
) exists on it