@brocan/env
Advanced tools
Comparing version 1.0.0 to 1.1.0
{ | ||
"name": "@brocan/env", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "A simple wrapper around node-config which provides a way to ensure the presence of required properties.", | ||
"main": "src/index.js", | ||
"repository": { | ||
"url": "https://github.com/battila7/brocan", | ||
"url": "https://github.com/battila7/brocan/tree/master/env", | ||
"type": "git" | ||
@@ -9,0 +9,0 @@ }, |
@@ -22,3 +22,3 @@ const config = require('config'); | ||
get(property) { | ||
return this.deps.config.get(property); | ||
return this.hasEnv(property) ? this.getEnv(property) : this.deps.config.get(property); | ||
}, | ||
@@ -32,3 +32,9 @@ getOrDefault(property, value) { | ||
has(property) { | ||
return this.deps.config.has(property); | ||
return this.hasEnv(property) || this.deps.config.has(property); | ||
}, | ||
hasEnv(property) { | ||
return Object.prototype.hasOwnProperty.call(process.env, property); | ||
}, | ||
getEnv(property) { | ||
return process.env[property]; | ||
} | ||
@@ -39,6 +45,2 @@ }; | ||
config.ensure = function ensure(properties) { | ||
}; | ||
module.exports = env; |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
2584
35
2