create-dotenv
Advanced tools
Comparing version 2.0.6 to 2.0.7
@@ -8,3 +8,3 @@ # Changelog | ||
## 2.0.6 (2022-08-29) | ||
## 2.0.7 (2022-08-29) | ||
@@ -11,0 +11,0 @@ ### Added |
{ | ||
"name": "create-dotenv", | ||
"version": "2.0.6", | ||
"version": "2.0.7", | ||
"description": "Loads environment variables from .env file", | ||
@@ -40,4 +40,5 @@ "publishConfig": { | ||
"dependencies": { | ||
"@jsdotenv/core": "^2.0.6", | ||
"minimist": "^1.2.6" | ||
"@jsdotenv/core": "^2.0.7", | ||
"minimist": "^1.2.6", | ||
"cross-spawn": "^7.0.3" | ||
}, | ||
@@ -44,0 +45,0 @@ "devDependencies": { |
# dotenv | ||
A Javascript (nodejs) port of the Go [dotenv](https://github.com/joho/godotenv) project (which loads env vars from a .env file). | ||
Written in typescript, full testing. | ||
From the original Library: | ||
It can loads environment variables from a `.env` file into [`process.env`](https://nodejs.org/docs/latest/api/process.html#process_process_env) or parse `<key>=<value>` string | ||
Storing configuration in the environment is one of the tenets of a twelve-factor app. Anything that is likely to change between deployment environments–such as resource handles for databases or credentials for external services–should be extracted from the code into environment variables. | ||
But it is not always practical to set environment variables on development machines or continuous integration servers where multiple projects are run. Dotenv load variables from a .env file into ENV when the environment is bootstrapped. | ||
It can be used as a library (for loading in env for your own daemons etc.) | ||
## Installation | ||
@@ -37,4 +31,2 @@ | ||
While `.env` in the project root is the default, you don't have to be constrained, both examples below are 100% legit | ||
If you want to be really fancy with your env file you can do comments and exports (below is a valid env file) | ||
@@ -55,1 +47,40 @@ | ||
``` | ||
Multiple line is OK. | ||
```shell | ||
MULTI_DOUBLE_QUOTED="THIS | ||
IS | ||
A | ||
MULTILINE | ||
STRING" | ||
``` | ||
Expand variables is OK. | ||
```shellOPTION_A=1 | ||
OPTION_B=${OPTION_A} | ||
OPTION_C=$OPTION_B | ||
OPTION_D=${OPTION_A}${OPTION_B} | ||
OPTION_E=${OPTION_NOT_DEFINED} | ||
``` | ||
## Command Mode | ||
```shell | ||
npm i create-dotenv -g | ||
``` | ||
### Usage | ||
Execute commands using key-value pairs. | ||
```shell | ||
dotenv-cli -v KEY=VALUE -- bash -c 'echo "$BASIC"' | ||
``` | ||
Execute commands using enviroment file. | ||
```shell | ||
dotenv-cli -e .env -- bash -c 'echo "$BASIC"' | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
85
0
9690
3
+ Addedcross-spawn@^7.0.3
Updated@jsdotenv/core@^2.0.7