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 CHANGED
@@ -5,7 +5,8 @@ A dotenv system that supports defaults
5
5
  ### Status
6
6
 
7
7
  ![npm](https://img.shields.io/npm/v/dotenv-defaults.svg)
8
- [![Greenkeeper badge](https://badges.greenkeeper.io/mrsteele/dotenv-defaults.svg)](https://greenkeeper.io/)
8
+ [![Main](https://github.com/mrsteele/dotenv-defaults/actions/workflows/main.yml/badge.svg)](https://github.com/mrsteele/dotenv-defaults/actions/workflows/main.yml)
9
+ [![dependabot badge](https://badgen.net/dependabot/mrsteele/dotenv-defaults?icon=dependabot)](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": "1.1.0",
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": "^6.2.0"
33
+ "dotenv": "^8.2.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "jest": "^25.0.0",
37
- "standard": "^13.0.1"
37
+ "standard": "^14.3.4"
38
38
  },
39
39
  "jest": {
40
40
  "coverageDirectory": "./coverage/",
package/src/index.js CHANGED
@@ -38,10 +38,7 @@ const config = (options = {}) => {
38
38
  }
39
39
  }
40
40
 
41
- const load = config
42
-
43
41
  module.exports = {
44
42
  parse,
45
- config,
46
- load
43
+ config
47
44
  }
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(`TEST=hello`)).toEqual({ TEST: 'hello' })
53
+ expect(Module.parse('TEST=hello')).toEqual({ TEST: 'hello' })
54
54
  })
55
55
 
56
56
  test('should include defaults', () => {
57
- const src = `TEST=hello`
58
- const defaults = `TEST2=goodbye`
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 = `TEST=hello`
67
- const defaults = `TEST=goodbye`
66
+ const src = 'TEST=hello'
67
+ const defaults = 'TEST=goodbye'
68
68
  expect(Module.parse(src, defaults)).toEqual({ TEST: 'hello' })
69
69
  })
70
70
  })