@nestjs/config
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -84,5 +84,13 @@ "use strict"; | ||
static loadEnvFile(options) { | ||
const envFilePath = options.envFilePath || path_1.resolve(process.cwd(), '.env'); | ||
const config = dotenv.parse(fs.readFileSync(envFilePath)); | ||
return config || {}; | ||
try { | ||
const envFilePath = options.envFilePath || path_1.resolve(process.cwd(), '.env'); | ||
const config = dotenv.parse(fs.readFileSync(envFilePath)); | ||
return config; | ||
} | ||
catch (err) { | ||
if (options.envFilePath || (err && err.code !== 'ENOENT')) { | ||
throw err; | ||
} | ||
return {}; | ||
} | ||
} | ||
@@ -89,0 +97,0 @@ static assignVariablesToProcess(config) { |
{ | ||
"name": "@nestjs/config", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "Nest - modern, fast, powerful node.js web framework (@config)", | ||
@@ -5,0 +5,0 @@ "author": "Kamil Mysliwiec", |
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
19498
332