@narando/config
Advanced tools
Comparing version 0.14.3 to 0.22.0
@@ -6,31 +6,30 @@ "use strict"; | ||
}); | ||
exports.default = void 0; | ||
var _path = require("path"); | ||
var _path = _interopRequireDefault(require("path")); | ||
var _path2 = _interopRequireDefault(_path); | ||
var _nconf = _interopRequireDefault(require("nconf")); | ||
var _nconf = require("nconf"); | ||
var _nconf2 = _interopRequireDefault(_nconf); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
const loadConfig = () => { | ||
const filepath = _path2.default.join(process.cwd(), "config.json"); | ||
const env = process.env.NODE_ENV || "dev"; | ||
const filepath = _path.default.join(process.cwd(), "config.json"); | ||
// Environment variables | ||
_nconf2.default.env({ parseValues: true, separator: "__" }); | ||
const env = process.env.NODE_ENV || "dev"; // Environment variables | ||
// Environment specific configuration file | ||
_nconf.default.env({ | ||
parseValues: true, | ||
separator: "__" | ||
}); // Environment specific configuration file | ||
var parts = filepath.split("."); | ||
parts.splice(parts.length - 1, 0, env); | ||
_nconf2.default.file(env, parts.join(".")); | ||
_nconf.default.file(env, parts.join(".")); // Default configuration file | ||
// Default configuration file | ||
_nconf2.default.file(filepath); | ||
return _nconf2.default.get(); | ||
_nconf.default.file(filepath); | ||
return _nconf.default.get(); | ||
}; | ||
@@ -43,2 +42,4 @@ | ||
exports.default = loadConfig(); | ||
var _default = loadConfig(); | ||
exports.default = _default; |
{ | ||
"name": "@narando/config", | ||
"version": "0.14.3", | ||
"version": "0.22.0", | ||
"description": "Read NODE_ENV dependent configuration files", | ||
@@ -10,3 +10,3 @@ "main": "dist/config.js", | ||
"scripts": { | ||
"build": "babel ./src -d dist", | ||
"build": "babel --root-mode upward ./src -d dist", | ||
"prepare": "npm run build", | ||
@@ -31,3 +31,9 @@ "test": "jest" | ||
"access": "public" | ||
} | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.2.0", | ||
"@babel/core": "^7.2.2", | ||
"@babel/node": "^7.2.2" | ||
}, | ||
"gitHead": "9c8b4f37690914ab272b6fe20cc7efa268186bb1" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3790
3