Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@types/dotenv-flow
Advanced tools
npm install --save @types/dotenv-flow
This package contains type definitions for dotenv-flow (https://github.com/kerimdzhanov/dotenv-flow).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/dotenv-flow/v2.
/// <reference types="node" />
export interface DotenvParseOptions {
/**
* You may turn on logging to help debug why certain keys or values are not being set as you expect.
*/
debug?: boolean | undefined;
}
export interface DotenvParseOutput {
[name: string]: string;
}
/**
* Parses a string or buffer in the .env file format into an object.
*
* @param src - contents to be parsed
* @param options - additional options
* @returns an object with keys and values based on `src`
*/
export function parse(
src: string | Buffer,
options?: DotenvParseOptions,
): DotenvParseOutput;
export interface DotenvConfigOptions {
/**
* Node environment (development/test/production/etc,.).
*/
node_env?: string | undefined;
/**
* Default node environment to use if `process.env.NODE_ENV` is not present.
*/
default_node_env?: string | undefined;
/**
* Path to `.env*` files directory.
*/
path?: string | undefined;
/**
* Encoding for reading the `.env*` files.
*/
encoding?: string | undefined;
/**
* In some cases the original "dotenv" library can be used by one of the dependent npm modules.
* It causes calling the original `dotenv.config()` that loads the `.env` file from your project before you can call `dotenv-flow.config()`.
*
* Such cases breaks `.env*` files priority because the previously loaded environment variables are treated as shell-defined thus having the higher priority.
*
* Setting the `purge_dotenv` option to `true` can gracefully fix this issue.
*/
purge_dotenv?: boolean | undefined;
}
export interface DotenvConfigOutput {
error?: Error | undefined;
parsed?: DotenvParseOutput | undefined;
}
/**
* Loads `.env` file contents into {@link https://nodejs.org/api/process.html#process_process_env | `process.env`}.
* Example: 'KEY=value' becomes { parsed: { KEY: 'value' } }
*
* @param options - controls behavior
* @returns an object with a `parsed` key if successful or `error` key if an error occurred
*/
export function config(options?: DotenvConfigOptions): DotenvConfigOutput;
These definitions were written by Dan Kerimdzhanov.
FAQs
TypeScript definitions for dotenv-flow
The npm package @types/dotenv-flow receives a total of 233,565 weekly downloads. As such, @types/dotenv-flow popularity was classified as popular.
We found that @types/dotenv-flow demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.