@johnmmackey/ms-utils 4.2.1 → 4.3.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 CHANGED
@@ -1,3 +1,6 @@
1
+ ## Version 4.3.0
2
+ * Ensure .env is the highest priority
3
+
1
4
  ## Version 4.2.1
2
5
  * Bug fix on load
3
6
 
package/README.md CHANGED
@@ -47,7 +47,7 @@ sendmail(
47
47
  * uses ```dotenv``` to load a .env file in the current working directory into the environment
48
48
  * pushes all items loaded from etcd into the environment.
49
49
 
50
- The order of precedence: etcd > .env > external set environment
50
+ The order of precedence: .env > .env > externally set environment
51
51
 
52
52
  ## Future
53
53
  * Add local queueing for log events when AMQP is not operative.
package/lib/config.js CHANGED
@@ -33,6 +33,11 @@ async function load(serviceName) {
33
33
 
34
34
  // as a side-effect, load these into process.env
35
35
  dotenv.populate(process.env, config, { override: true });
36
+
37
+ // load any .env file that may be present into the environment
38
+ // again to override
39
+ // why? the first one may be necessary to find an etcd server...
40
+ dotenv.config({ override: true });
36
41
  return config;
37
42
  }
38
43
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@johnmmackey/ms-utils",
3
- "version": "4.2.1",
3
+ "version": "4.3.0",
4
4
  "description": "Utility functions for Microservice Architecture",
5
5
  "main": "index.js",
6
6
  "scripts": {