@dotenvx/dotenvx 1.32.0 → 1.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -1
- package/README.md +33 -32
- package/package.json +11 -1
- package/src/cli/dotenvx.js +3 -3
- package/src/lib/config.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
-
[Unreleased](https://github.com/dotenvx/dotenvx/compare/v1.
|
|
5
|
+
[Unreleased](https://github.com/dotenvx/dotenvx/compare/v1.33.0...main)
|
|
6
|
+
|
|
7
|
+
## [1.33.0](https://github.com/dotenvx/dotenvx/compare/v1.32.1...v1.33.0)
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
* support ESM import convenience `import '@dotenvx/dotenvx/config'` ([#508](https://github.com/dotenvx/dotenvx/pull/508))
|
|
12
|
+
|
|
13
|
+
## [1.32.1](https://github.com/dotenvx/dotenvx/compare/v1.32.0...v1.32.1)
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
* remove duplicated help messages ([#504](https://github.com/dotenvx/dotenvx/pull/504))
|
|
6
18
|
|
|
7
19
|
## [1.32.0](https://github.com/dotenvx/dotenvx/compare/v1.31.3...v1.32.0)
|
|
8
20
|
|
package/README.md
CHANGED
|
@@ -19,6 +19,7 @@ npm install @dotenvx/dotenvx --save
|
|
|
19
19
|
```js
|
|
20
20
|
// index.js
|
|
21
21
|
require('@dotenvx/dotenvx').config()
|
|
22
|
+
// or import('@dotenvx/dotenvx/config') if you're using esm
|
|
22
23
|
|
|
23
24
|
console.log(`Hello ${process.env.HELLO}`)
|
|
24
25
|
```
|
|
@@ -80,7 +81,7 @@ tar -xzf dotenvx.tar.gz
|
|
|
80
81
|
</details>
|
|
81
82
|
|
|
82
83
|
|
|
83
|
-
<details><summary>or
|
|
84
|
+
<details><summary>or windows 🪟</summary><br>
|
|
84
85
|
|
|
85
86
|
```sh
|
|
86
87
|
winget install dotenvx
|
|
@@ -427,7 +428,7 @@ More examples
|
|
|
427
428
|
> start
|
|
428
429
|
> ./node_modules/.bin/dotenvx run -- node index.js
|
|
429
430
|
|
|
430
|
-
[dotenvx]
|
|
431
|
+
[dotenvx@1.X.X] injecting env (1) from .env.production
|
|
431
432
|
Hello World
|
|
432
433
|
```
|
|
433
434
|
|
|
@@ -504,7 +505,7 @@ $ echo "HELLO=production" > .env.production
|
|
|
504
505
|
$ echo "console.log('Hello ' + process.env.HELLO)" > index.js
|
|
505
506
|
|
|
506
507
|
$ dotenvx run -f .env.production -- node index.js
|
|
507
|
-
[dotenvx]
|
|
508
|
+
[dotenvx@1.X.X] injecting env (1) from .env.production
|
|
508
509
|
Hello production
|
|
509
510
|
> ^^
|
|
510
511
|
```
|
|
@@ -519,7 +520,7 @@ More examples
|
|
|
519
520
|
$ echo "HELLO=World" > .env
|
|
520
521
|
|
|
521
522
|
$ dotenvx run -f .env.local -f .env -- node index.js
|
|
522
|
-
[dotenvx]
|
|
523
|
+
[dotenvx@1.X.X] injecting env (1) from .env.local,.env
|
|
523
524
|
Hello local
|
|
524
525
|
```
|
|
525
526
|
|
|
@@ -533,7 +534,7 @@ More examples
|
|
|
533
534
|
$ echo "HELLO=World" > .env
|
|
534
535
|
|
|
535
536
|
$ dotenvx run -f .env.local -f .env --overload -- node index.js
|
|
536
|
-
[dotenvx]
|
|
537
|
+
[dotenvx@1.X.X] injecting env (1) from .env.local,.env
|
|
537
538
|
Hello World
|
|
538
539
|
```
|
|
539
540
|
|
|
@@ -545,7 +546,7 @@ More examples
|
|
|
545
546
|
$ dotenvx run -f .env.production --verbose -- node index.js
|
|
546
547
|
[dotenvx][verbose] injecting env from /path/to/.env.production
|
|
547
548
|
[dotenvx][verbose] HELLO set
|
|
548
|
-
[dotenvx]
|
|
549
|
+
[dotenvx@1.X.X] injecting env (1) from .env.production
|
|
549
550
|
Hello production
|
|
550
551
|
```
|
|
551
552
|
|
|
@@ -564,7 +565,7 @@ More examples
|
|
|
564
565
|
[dotenvx][debug] writing env from /path/to/.env.production
|
|
565
566
|
[dotenvx][verbose] HELLO set
|
|
566
567
|
[dotenvx][debug] HELLO set to production
|
|
567
|
-
[dotenvx]
|
|
568
|
+
[dotenvx@1.X.X] injecting env (1) from .env.production
|
|
568
569
|
Hello production
|
|
569
570
|
```
|
|
570
571
|
|
|
@@ -638,7 +639,7 @@ More examples
|
|
|
638
639
|
$ echo "console.log('Hello ' + process.env.HELLO)" > index.js
|
|
639
640
|
|
|
640
641
|
$ dotenvx run -- node index.js
|
|
641
|
-
[dotenvx] injecting env (2) from .env
|
|
642
|
+
[dotenvx@1.X.X] injecting env (2) from .env
|
|
642
643
|
Hello World
|
|
643
644
|
```
|
|
644
645
|
|
|
@@ -651,7 +652,7 @@ More examples
|
|
|
651
652
|
$ echo "console.log('Hello ' + process.env.HELLO)" > index.js
|
|
652
653
|
|
|
653
654
|
$ DOTENV_PRIVATE_KEY_PRODUCTION="<.env.production private key>" dotenvx run -- node index.js
|
|
654
|
-
[dotenvx] injecting env (2) from .env.production
|
|
655
|
+
[dotenvx@1.X.X] injecting env (2) from .env.production
|
|
655
656
|
Hello Production
|
|
656
657
|
```
|
|
657
658
|
|
|
@@ -666,7 +667,7 @@ More examples
|
|
|
666
667
|
$ echo "console.log('Hello ' + process.env.HELLO)" > index.js
|
|
667
668
|
|
|
668
669
|
$ DOTENV_PRIVATE_KEY_CI="<.env.ci private key>" dotenvx run -- node index.js
|
|
669
|
-
[dotenvx] injecting env (2) from .env.ci
|
|
670
|
+
[dotenvx@1.X.X] injecting env (2) from .env.ci
|
|
670
671
|
Hello Ci
|
|
671
672
|
```
|
|
672
673
|
|
|
@@ -681,7 +682,7 @@ More examples
|
|
|
681
682
|
$ echo "console.log('Hello ' + process.env.HELLO)" > index.js
|
|
682
683
|
|
|
683
684
|
$ DOTENV_PRIVATE_KEY="<.env private key>" DOTENV_PRIVATE_KEY_PRODUCTION="<.env.production private key>" dotenvx run -- node index.js
|
|
684
|
-
[dotenvx] injecting env (3) from .env, .env.production
|
|
685
|
+
[dotenvx@1.X.X] injecting env (3) from .env, .env.production
|
|
685
686
|
Hello World
|
|
686
687
|
```
|
|
687
688
|
|
|
@@ -698,11 +699,11 @@ More examples
|
|
|
698
699
|
$ echo "console.log('Hello ' + process.env.HELLO)" > index.js
|
|
699
700
|
|
|
700
701
|
$ DOTENV_PRIVATE_KEY_CI="<app1/privat ci key>,<app2/private ci key>" dotenvx run -f app1/.env.ci -f app2/.env.ci -- node index.js
|
|
701
|
-
[dotenvx] injecting env (2) from app1/.env.ci,app2/.env.ci
|
|
702
|
+
[dotenvx@1.X.X] injecting env (2) from app1/.env.ci,app2/.env.ci
|
|
702
703
|
Hello app1
|
|
703
704
|
|
|
704
705
|
$ DOTENV_PRIVATE_KEY_CI="<app1/privat ci key>,<app2/private ci key>" dotenvx run -f app1/.env.ci -f app2/.env.ci --overload -- node index.js
|
|
705
|
-
[dotenvx] injecting env (2) from app1/.env.ci,app2/.env.ci
|
|
706
|
+
[dotenvx@1.X.X] injecting env (2) from app1/.env.ci,app2/.env.ci
|
|
706
707
|
Hello app2
|
|
707
708
|
```
|
|
708
709
|
|
|
@@ -749,7 +750,7 @@ More examples
|
|
|
749
750
|
```
|
|
750
751
|
```sh
|
|
751
752
|
$ dotenvx run --debug -- node index.js
|
|
752
|
-
[dotenvx] injecting env (2) from .env
|
|
753
|
+
[dotenvx@1.X.X] injecting env (2) from .env
|
|
753
754
|
DATABASE_URL postgres://username@localhost/my_database
|
|
754
755
|
```
|
|
755
756
|
|
|
@@ -768,7 +769,7 @@ More examples
|
|
|
768
769
|
```
|
|
769
770
|
```sh
|
|
770
771
|
$ dotenvx run --debug -- node index.js
|
|
771
|
-
[dotenvx] injecting env (1) from .env
|
|
772
|
+
[dotenvx@1.X.X] injecting env (1) from .env
|
|
772
773
|
DATABASE_URL postgres://yourusername@localhost/my_database
|
|
773
774
|
```
|
|
774
775
|
|
|
@@ -793,7 +794,7 @@ More examples
|
|
|
793
794
|
$ echo "console.log('Hello ' + process.env.HELLO)" > index.js
|
|
794
795
|
|
|
795
796
|
$ dotenvx run -f .env.local -f .env -- node index.js
|
|
796
|
-
[dotenvx] injecting env (1) from .env.local, .env
|
|
797
|
+
[dotenvx@1.X.X] injecting env (1) from .env.local, .env
|
|
797
798
|
Hello local
|
|
798
799
|
```
|
|
799
800
|
|
|
@@ -807,7 +808,7 @@ More examples
|
|
|
807
808
|
$ echo "console.log('Hello ' + process.env.HELLO)" > index.js
|
|
808
809
|
|
|
809
810
|
$ dotenvx run --env HELLO=String -f .env -- node index.js
|
|
810
|
-
[dotenvx] injecting env (1) from .env, and --env flag
|
|
811
|
+
[dotenvx@1.X.X] injecting env (1) from .env, and --env flag
|
|
811
812
|
Hello String
|
|
812
813
|
```
|
|
813
814
|
|
|
@@ -822,7 +823,7 @@ More examples
|
|
|
822
823
|
$ echo "console.log('Hello ' + process.env.HELLO)" > index.js
|
|
823
824
|
|
|
824
825
|
$ dotenvx run -f .env.local -f .env --overload -- node index.js
|
|
825
|
-
[dotenvx] injecting env (1) from .env.local, .env
|
|
826
|
+
[dotenvx@1.X.X] injecting env (1) from .env.local, .env
|
|
826
827
|
Hello World
|
|
827
828
|
```
|
|
828
829
|
|
|
@@ -838,7 +839,7 @@ More examples
|
|
|
838
839
|
|
|
839
840
|
# check your .env.keys files for your privateKey
|
|
840
841
|
$ DOTENV_PRIVATE_KEY="122...0b8" dotenvx run -- node index.js
|
|
841
|
-
[dotenvx] injecting env (2) from .env
|
|
842
|
+
[dotenvx@1.X.X] injecting env (2) from .env
|
|
842
843
|
Hello encrypted
|
|
843
844
|
```
|
|
844
845
|
|
|
@@ -854,7 +855,7 @@ More examples
|
|
|
854
855
|
|
|
855
856
|
# check .env.keys for your privateKey
|
|
856
857
|
$ DOTENV_PRIVATE_KEY_PRODUCTION="122...0b8" dotenvx run -- node index.js
|
|
857
|
-
[dotenvx] injecting env (2) from .env.production
|
|
858
|
+
[dotenvx@1.X.X] injecting env (2) from .env.production
|
|
858
859
|
Hello production encrypted
|
|
859
860
|
```
|
|
860
861
|
|
|
@@ -872,7 +873,7 @@ More examples
|
|
|
872
873
|
|
|
873
874
|
# check .env.keys for your privateKey
|
|
874
875
|
$ DOTENV_PRIVATE_KEY_CI="122...0b8" dotenvx run -- node index.js
|
|
875
|
-
[dotenvx] injecting env (2) from .env.ci
|
|
876
|
+
[dotenvx@1.X.X] injecting env (2) from .env.ci
|
|
876
877
|
Hello ci encrypted
|
|
877
878
|
```
|
|
878
879
|
|
|
@@ -892,11 +893,11 @@ More examples
|
|
|
892
893
|
|
|
893
894
|
# check .env.keys for your privateKeys
|
|
894
895
|
$ DOTENV_PRIVATE_KEY="122...0b8" DOTENV_PRIVATE_KEY_PRODUCTION="122...0b8" dotenvx run -- node index.js
|
|
895
|
-
[dotenvx] injecting env (3) from .env, .env.production
|
|
896
|
+
[dotenvx@1.X.X] injecting env (3) from .env, .env.production
|
|
896
897
|
Hello encrypted
|
|
897
898
|
|
|
898
899
|
$ DOTENV_PRIVATE_KEY_PRODUCTION="122...0b8" DOTENV_PRIVATE_KEY="122...0b8" dotenvx run -- node index.js
|
|
899
|
-
[dotenvx] injecting env (3) from .env.production, .env
|
|
900
|
+
[dotenvx@1.X.X] injecting env (3) from .env.production, .env
|
|
900
901
|
Hello production encrypted
|
|
901
902
|
```
|
|
902
903
|
|
|
@@ -914,7 +915,7 @@ More examples
|
|
|
914
915
|
$ dotenvx run -f .env.production --verbose -- node index.js
|
|
915
916
|
loading env from .env.production (/path/to/.env.production)
|
|
916
917
|
HELLO set
|
|
917
|
-
[dotenvx] injecting env (1) from .env.production
|
|
918
|
+
[dotenvx@1.X.X] injecting env (1) from .env.production
|
|
918
919
|
Hello production
|
|
919
920
|
```
|
|
920
921
|
|
|
@@ -934,7 +935,7 @@ More examples
|
|
|
934
935
|
{"HELLO":"production"}
|
|
935
936
|
HELLO set
|
|
936
937
|
HELLO set to production
|
|
937
|
-
[dotenvx] injecting env (1) from .env.production
|
|
938
|
+
[dotenvx@1.X.X] injecting env (1) from .env.production
|
|
938
939
|
executing process command [node index.js]
|
|
939
940
|
expanding process command to [/opt/homebrew/bin/node index.js]
|
|
940
941
|
Hello production
|
|
@@ -1008,7 +1009,7 @@ More examples
|
|
|
1008
1009
|
$ echo "console.log('Hello ' + process.env.HELLO)" > index.js
|
|
1009
1010
|
|
|
1010
1011
|
$ dotenvx run --convention=nextjs -- node index.js
|
|
1011
|
-
[dotenvx] injecting env (1) from .env.development.local, .env.local, .env.development, .env
|
|
1012
|
+
[dotenvx@1.X.X] injecting env (1) from .env.development.local, .env.local, .env.development, .env
|
|
1012
1013
|
Hello development local
|
|
1013
1014
|
```
|
|
1014
1015
|
|
|
@@ -1736,7 +1737,7 @@ More examples
|
|
|
1736
1737
|
$ echo "console.log('Hello ' + process.env.HELLO)" > index.js
|
|
1737
1738
|
|
|
1738
1739
|
$ dotenvx run -- node index.js
|
|
1739
|
-
[dotenvx] injecting env (1) from .env
|
|
1740
|
+
[dotenvx@1.X.X] injecting env (1) from .env
|
|
1740
1741
|
Hello World
|
|
1741
1742
|
```
|
|
1742
1743
|
|
|
@@ -1905,7 +1906,7 @@ More examples
|
|
|
1905
1906
|
|
|
1906
1907
|
```sh
|
|
1907
1908
|
$ node index.js
|
|
1908
|
-
[dotenvx@1.
|
|
1909
|
+
[dotenvx@1.X.X] injecting env (1) from .env
|
|
1909
1910
|
Hello World
|
|
1910
1911
|
```
|
|
1911
1912
|
|
|
@@ -1935,7 +1936,7 @@ More examples
|
|
|
1935
1936
|
|
|
1936
1937
|
```sh
|
|
1937
1938
|
$ node index.js
|
|
1938
|
-
[dotenvx@1.
|
|
1939
|
+
[dotenvx@1.X.X] injecting env (1) from .env.local, .env
|
|
1939
1940
|
Hello Me
|
|
1940
1941
|
```
|
|
1941
1942
|
|
|
@@ -1963,7 +1964,7 @@ More examples
|
|
|
1963
1964
|
|
|
1964
1965
|
```sh
|
|
1965
1966
|
$ node index.js
|
|
1966
|
-
[dotenvx@1.
|
|
1967
|
+
[dotenvx@1.X.X] injecting env (1) from .env.local, .env
|
|
1967
1968
|
Hello World
|
|
1968
1969
|
```
|
|
1969
1970
|
|
|
@@ -2008,7 +2009,7 @@ More examples
|
|
|
2008
2009
|
|
|
2009
2010
|
```sh
|
|
2010
2011
|
$ node index.js
|
|
2011
|
-
[dotenvx@1.
|
|
2012
|
+
[dotenvx@1.X.X] injecting env (1) from .env
|
|
2012
2013
|
Hello World
|
|
2013
2014
|
```
|
|
2014
2015
|
|
|
@@ -2024,7 +2025,7 @@ More examples
|
|
|
2024
2025
|
|
|
2025
2026
|
```js
|
|
2026
2027
|
// index.js
|
|
2027
|
-
require('@dotenvx/dotenvx').config({envKeysFile: '../../.env.keys'})
|
|
2028
|
+
require('@dotenvx/dotenvx').config({path: ['.env'], envKeysFile: '../../.env.keys'})
|
|
2028
2029
|
```
|
|
2029
2030
|
|
|
2030
2031
|
</details>
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.
|
|
2
|
+
"version": "1.33.0",
|
|
3
3
|
"name": "@dotenvx/dotenvx",
|
|
4
4
|
"description": "a better dotenv–from the creator of `dotenv`",
|
|
5
5
|
"author": "@motdotla",
|
|
@@ -19,6 +19,16 @@
|
|
|
19
19
|
],
|
|
20
20
|
"main": "src/lib/main.js",
|
|
21
21
|
"types": "src/lib/main.d.ts",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./src/lib/main.d.ts",
|
|
25
|
+
"require": "./src/lib/main.js",
|
|
26
|
+
"default": "./src/lib/main.js"
|
|
27
|
+
},
|
|
28
|
+
"./config": "./src/lib/config.js",
|
|
29
|
+
"./config.js": "./src/lib/config.js",
|
|
30
|
+
"./package.json": "./package.json"
|
|
31
|
+
},
|
|
22
32
|
"bin": {
|
|
23
33
|
"dotenvx": "./src/cli/dotenvx.js",
|
|
24
34
|
"git-dotenvx": "./src/cli/dotenvx.js"
|
package/src/cli/dotenvx.js
CHANGED
|
@@ -59,7 +59,7 @@ program.command('run')
|
|
|
59
59
|
.option('-fk, --env-keys-file <path>', 'path to your .env.keys file (default: same path as your env file)')
|
|
60
60
|
.option('-fv, --env-vault-file <paths...>', 'path(s) to your .env.vault file(s)', collectEnvs('envVaultFile'), [])
|
|
61
61
|
.option('-o, --overload', 'override existing env variables')
|
|
62
|
-
.option('--strict', 'process.exit(1) on any errors
|
|
62
|
+
.option('--strict', 'process.exit(1) on any errors', false)
|
|
63
63
|
.option('--convention <name>', 'load a .env convention (available conventions: [\'nextjs\'])')
|
|
64
64
|
.option('--ignore <errorCodes...>', 'error code(s) to ignore (example: --ignore=MISSING_ENV_FILE)')
|
|
65
65
|
.action(function (...args) {
|
|
@@ -78,7 +78,7 @@ program.command('get')
|
|
|
78
78
|
.option('-fk, --env-keys-file <path>', 'path to your .env.keys file (default: same path as your env file)')
|
|
79
79
|
.option('-fv, --env-vault-file <paths...>', 'path(s) to your .env.vault file(s)', collectEnvs('envVaultFile'), [])
|
|
80
80
|
.option('-o, --overload', 'override existing env variables')
|
|
81
|
-
.option('--strict', 'process.exit(1) on any errors
|
|
81
|
+
.option('--strict', 'process.exit(1) on any errors', false)
|
|
82
82
|
.option('--convention <name>', 'load a .env convention (available conventions: [\'nextjs\'])')
|
|
83
83
|
.option('--ignore <errorCodes...>', 'error code(s) to ignore (example: --ignore=MISSING_ENV_FILE)')
|
|
84
84
|
.option('-a, --all', 'include all machine envs as well')
|
|
@@ -100,7 +100,7 @@ program.command('set')
|
|
|
100
100
|
.argument('value', 'value')
|
|
101
101
|
.option('-f, --env-file <paths...>', 'path(s) to your env file(s)', collectEnvs('envFile'), [])
|
|
102
102
|
.option('-fk, --env-keys-file <path>', 'path to your .env.keys file (default: same path as your env file)')
|
|
103
|
-
.option('-c, --encrypt', 'encrypt value
|
|
103
|
+
.option('-c, --encrypt', 'encrypt value', true)
|
|
104
104
|
.option('-p, --plain', 'store value as plain text', false)
|
|
105
105
|
.action(function (...args) {
|
|
106
106
|
this.envs = envs
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('./main.js').config()
|