Comparing version 16.1.1 to 16.1.2
@@ -7,2 +7,8 @@ # Changelog | ||
## [16.1.2](https://github.com/motdotla/dotenv/compare/v16.1.1...v16.1.2) (2023-05-31) | ||
### Changed | ||
- Exposed private function `_configDotenv` as `configDotenv`. [#744](https://github.com/motdotla/dotenv/pull/744) | ||
## [16.1.1](https://github.com/motdotla/dotenv/compare/v16.1.0...v16.1.1) (2023-05-30) | ||
@@ -9,0 +15,0 @@ |
@@ -93,3 +93,3 @@ // TypeScript Version: 3.0 | ||
/** | ||
* Loads `.env` file contents into process.env. | ||
* Loads `.env` file contents into process.env by default. If `DOTENV_KEY` is present, it smartly attempts to load encrypted `.env.vault` file contents into process.env. | ||
* | ||
@@ -105,2 +105,13 @@ * See https://docs.dotenv.org | ||
/** | ||
* Loads `.env` file contents into process.env. | ||
* | ||
* See https://docs.dotenv.org | ||
* | ||
* @param options - additional options. example: `{ path: './custom/path', encoding: 'latin1', debug: true, override: false }` | ||
* @returns an object with a `parsed` key if successful or `error` key if an error occurred. example: { parsed: { KEY: 'value' } } | ||
* | ||
*/ | ||
export function configDotenv(options?: DotenvConfigOptions): DotenvConfigOutput; | ||
/** | ||
* Loads `source` json contents into `target` like process.env. | ||
@@ -107,0 +118,0 @@ * |
@@ -54,3 +54,3 @@ const fs = require('fs') | ||
// Parse .env.vault | ||
const result = DotenvModule._configDotenv({ path: vaultPath }) | ||
const result = DotenvModule.configDotenv({ path: vaultPath }) | ||
if (!result.parsed) { | ||
@@ -171,3 +171,3 @@ throw new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`) | ||
function _configDotenv (options) { | ||
function configDotenv (options) { | ||
let dotenvPath = path.resolve(process.cwd(), '.env') | ||
@@ -208,3 +208,3 @@ let encoding = 'utf8' | ||
if (_dotenvKey().length === 0) { | ||
return DotenvModule._configDotenv(options) | ||
return DotenvModule.configDotenv(options) | ||
} | ||
@@ -216,3 +216,3 @@ | ||
return DotenvModule._configDotenv(options) | ||
return DotenvModule.configDotenv(options) | ||
} | ||
@@ -284,3 +284,3 @@ | ||
const DotenvModule = { | ||
_configDotenv, | ||
configDotenv, | ||
_configVault, | ||
@@ -294,3 +294,3 @@ _parseVault, | ||
module.exports._configDotenv = DotenvModule._configDotenv | ||
module.exports.configDotenv = DotenvModule.configDotenv | ||
module.exports._configVault = DotenvModule._configVault | ||
@@ -297,0 +297,0 @@ module.exports._parseVault = DotenvModule._parseVault |
{ | ||
"name": "dotenv", | ||
"version": "16.1.1", | ||
"version": "16.1.2", | ||
"description": "Loads environment variables from .env file", | ||
@@ -5,0 +5,0 @@ "main": "lib/main.js", |
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
66554
392