UNPKG

@liplum/env

Version:

Reading and parsing environment variables from "process.env"

27 lines (26 loc) 803 B
import { EnvMixin } from "./shared.js"; export interface BoolEnvValueOptions { /** * If enabled, "yes" and "y" will be considered as `true`, * while "no" and "n" will be considered as `false`. * * false by default. */ yesOrNo?: boolean; /** * The strings will be considered as `true` */ truthy?: string[]; /** * The strings will be considered as `false` */ falsy?: string[]; } export interface IBoolEnv { getOrNull: (options?: BoolEnvValueOptions) => boolean | undefined; get: (options?: BoolEnvValueOptions) => boolean; } export declare class BoolEnv extends EnvMixin<boolean> implements IBoolEnv { getOrNull: (options?: BoolEnvValueOptions) => boolean | undefined; get: (options?: BoolEnvValueOptions) => boolean; }