@types/dotenv-safe
TypeScript icon, indicating that this package has built-in type declarations

8.1.6 • Public • Published

Installation

npm install --save @types/dotenv-safe

Summary

This package contains type definitions for dotenv-safe (https://github.com/rolodato/dotenv-safe).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/dotenv-safe.

index.d.ts

import dotenv = require("dotenv");

export interface MissingEnvVarsError extends Error {
    /**
     * Path to example environment file.
     */
    sample: string;

    /**
     * Variables which existing in the sample file, but not in the loaded file.
     */
    missing: string[];
}

export interface DotenvSafeOptions extends dotenv.DotenvConfigOptions {
    /**
     * Path to environment file.
     * @default ".env"
     */
    path?: string | undefined;

    /**
     * Path to example environment file. (Option 1)
     * @default ".env.example"
     */
    example?: string | undefined;

    /**
     * Path to example environment file. (Option 2 -- example takes precedence)
     * @default ".env.example"
     */
    sample?: string | undefined;

    /**
     * Enabling this option will not throw an error after loading.
     * @default false
     */
    allowEmptyValues?: boolean | undefined;
}

export interface DotenvSafeConfigOutput extends dotenv.DotenvConfigOutput {
    /**
     * key-value pairs required by .env.example
     */
    required: dotenv.DotenvParseOutput;
}

/**
 * Loads environment variables file into 'process.env'.
 *
 * @throws MissingEnvVarsError
 */
export function config(options?: DotenvSafeOptions): DotenvSafeConfigOutput;

Additional Details

Credits

These definitions were written by Stan Goldmann.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/dotenv-safe

Weekly Downloads

63,208

Version

8.1.6

License

MIT

Unpacked Size

5.24 kB

Total Files

5

Last publish

Collaborators

  • types