lagash-config
Advanced tools
Comparing version 0.1.1 to 0.1.2
export default class Config { | ||
private static config; | ||
static tryLoadEnvFromFile(filename: string): boolean; | ||
static tryLoadEnvAtRootOrParent(filename: string): void; | ||
static initConfig(): void; | ||
@@ -5,0 +6,0 @@ static get(key: string): string; |
@@ -45,7 +45,14 @@ /********************************************************************************* | ||
} | ||
static tryLoadEnvAtRootOrParent(filename) { | ||
if (!this.tryLoadEnvFromFile(`./${filename}`)) { | ||
this.tryLoadEnvFromFile(`../${filename}`); | ||
} | ||
} | ||
static initConfig() { | ||
if (!Config.tryLoadEnvFromFile("./config.env")) { | ||
Config.tryLoadEnvFromFile("../config.env"); | ||
} | ||
Config.config = NConf.argv() | ||
this.tryLoadEnvAtRootOrParent("config.env"); | ||
this.tryLoadEnvAtRootOrParent("config.local.env"); | ||
this.tryLoadEnvAtRootOrParent("config.test.env"); | ||
this.tryLoadEnvAtRootOrParent("config.latest.env"); | ||
this.tryLoadEnvAtRootOrParent("config.stable.env"); | ||
this.config = NConf.argv() | ||
.env() | ||
@@ -52,0 +59,0 @@ .file("default", "./config.json"); |
{ | ||
"name": "lagash-config", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Lagash simple nconf wrapper.", | ||
@@ -5,0 +5,0 @@ "main": "js/index.js", |
Sorry, the diff of this file is not supported yet
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
6930
77