From 80fff4bbf052c68e51b7a3efcca6e9322621202a Mon Sep 17 00:00:00 2001 From: Scott Motte Date: Sat, 17 Jun 2023 09:34:41 -0700 Subject: [PATCH] Add type definition for DOTENV_KEY --- CHANGELOG.md | 8 +++++++- lib/main.d.ts | 11 ++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ca9a0d6..c15fd30c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,13 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. -## [Unreleased](https://github.com/motdotla/dotenv/compare/v16.3.0...master) +## [Unreleased](https://github.com/motdotla/dotenv/compare/v16.3.1...master) + +## [16.3.1](https://github.com/motdotla/dotenv/compare/v16.3.0...v16.3.1) (2023-06-17) + +### Added + +- Add missing type definitions for `processEnv` and `DOTENV_KEY` options. [#756](https://github.com/motdotla/dotenv/pull/756) ## [16.3.0](https://github.com/motdotla/dotenv/compare/v16.2.0...v16.3.0) (2023-06-16) diff --git a/lib/main.d.ts b/lib/main.d.ts index 7ac6efba..af84746f 100644 --- a/lib/main.d.ts +++ b/lib/main.d.ts @@ -59,11 +59,20 @@ export interface DotenvConfigOptions { /** * Default: `process.env` * - * Override any environment variables that have already been set on your machine with values from your .env file. + * Specify an object to write your secrets to. Defaults to process.env environment variables. * * example: `const processEnv = {}; require('dotenv').config({ processEnv: processEnv })` */ processEnv?: DotenvPopulateInput; + + /** + * Default: `undefined` + * + * Pass the DOTENV_KEY directly to config options. Defaults to looking for process.env.DOTENV_KEY environment variable. Note this only applies to decrypting .env.vault files. If passed as null or undefined, or not passed at all, dotenv falls back to its traditional job of parsing a .env file. + * + * example: `require('dotenv').config({ DOTENV_KEY: 'dotenv://:key_1234…@dotenv.org/vault/.env.vault?environment=production' })` + */ + DOTENV_KEY?: string; } export interface DotenvConfigOutput {