dotenv-defaults 1.1.0 → 2.0.2
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/README.md +2 -1
- package/config.js +7 -0
- package/package.json +6 -6
- package/src/index.js +1 -4
- package/src/index.test.js +5 -5
package/README.md
CHANGED
|
@@ -5,7 +5,8 @@ A dotenv system that supports defaults
|
|
|
5
5
|
### Status
|
|
6
6
|
|
|
7
7
|

|
|
8
|
-
[](https://github.com/mrsteele/dotenv-defaults/actions/workflows/main.yml)
|
|
9
|
+
[](https://dependabot.com/)
|
|
9
10
|
|
|
10
11
|
### Installation
|
|
11
12
|
|
package/config.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// The purpose of this file is to be able to load the module with...
|
|
2
|
+
// ... "require("dotenv-defaults/config")" in JavaScript or "import "dotenv-defaults/config"" in TypeScript...
|
|
3
|
+
// ... or "node -r dotenv-defaults/config script.js" from the command line
|
|
4
|
+
|
|
5
|
+
(function () {
|
|
6
|
+
require('./src/index').config()
|
|
7
|
+
})()
|
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dotenv-defaults",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "dotenv... but with defaults!",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "jest",
|
|
8
|
-
"lint": "standard"
|
|
9
|
-
"travis": "npm run lint && npm t"
|
|
8
|
+
"lint": "standard"
|
|
10
9
|
},
|
|
11
10
|
"repository": {
|
|
12
11
|
"type": "git",
|
|
@@ -26,15 +25,16 @@
|
|
|
26
25
|
"url": "https://github.com/mrsteele/dotenv-defaults/issues"
|
|
27
26
|
},
|
|
28
27
|
"files": [
|
|
29
|
-
"src"
|
|
28
|
+
"src",
|
|
29
|
+
"config.js"
|
|
30
30
|
],
|
|
31
31
|
"homepage": "https://github.com/mrsteele/dotenv-defaults#readme",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"dotenv": "^
|
|
33
|
+
"dotenv": "^8.2.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"jest": "^25.0.0",
|
|
37
|
-
"standard": "^
|
|
37
|
+
"standard": "^14.3.4"
|
|
38
38
|
},
|
|
39
39
|
"jest": {
|
|
40
40
|
"coverageDirectory": "./coverage/",
|
package/src/index.js
CHANGED
package/src/index.test.js
CHANGED
|
@@ -50,12 +50,12 @@ describe('dotenv-defaults', () => {
|
|
|
50
50
|
})
|
|
51
51
|
|
|
52
52
|
test('should read variables', () => {
|
|
53
|
-
expect(Module.parse(
|
|
53
|
+
expect(Module.parse('TEST=hello')).toEqual({ TEST: 'hello' })
|
|
54
54
|
})
|
|
55
55
|
|
|
56
56
|
test('should include defaults', () => {
|
|
57
|
-
const src =
|
|
58
|
-
const defaults =
|
|
57
|
+
const src = 'TEST=hello'
|
|
58
|
+
const defaults = 'TEST2=goodbye'
|
|
59
59
|
expect(Module.parse(src, defaults)).toEqual({
|
|
60
60
|
TEST: 'hello',
|
|
61
61
|
TEST2: 'goodbye'
|
|
@@ -63,8 +63,8 @@ describe('dotenv-defaults', () => {
|
|
|
63
63
|
})
|
|
64
64
|
|
|
65
65
|
test('should not override defaults', () => {
|
|
66
|
-
const src =
|
|
67
|
-
const defaults =
|
|
66
|
+
const src = 'TEST=hello'
|
|
67
|
+
const defaults = 'TEST=goodbye'
|
|
68
68
|
expect(Module.parse(src, defaults)).toEqual({ TEST: 'hello' })
|
|
69
69
|
})
|
|
70
70
|
})
|