UNPKG

yini-parser

Version:

Readable configuration without YAML foot-guns or JSON noise. The official Node.js parser for YINI config format — An INI-inspired configuration format with clear nesting, explicit types, and predictable parsing.

35 lines (34 loc) 1.63 kB
/** * NODE_ENV - Defacto Node.js modes (environments) * * Used in many JS frameworks and tools, for special purposes. * Some even only know 'production' and treat everything else as 'development'. * Also Jest sets NODE_ENV automatically to 'test'. */ type TNodeEnv = 'development' | 'production' | 'test'; /** * APP_ENV - More custom envs (more finer-grained control) for this project. * @note Since this is a library (as opposed to a Web/App), we don't use "staging". */ type TAppEnv = 'local' | 'ci' | 'production'; declare const localNodeEnv: TNodeEnv; declare const localAppEnv: TAppEnv; /** Are we running in the environment "development"? Will be based on the (global) environment variable process.env.NODE_ENV. */ export declare const isDevEnv: () => boolean; /** Are we running in the environment "production"? Will be based on the (global) environment variable process.env.NODE_ENV. */ export declare const isProdEnv: () => boolean; /** Are we running in the environment "test"? Will be based on the (global) variable process.env.NODE_ENV. */ export declare const isTestEnv: () => boolean; /** Will be based on the local argument when this process was launched. * @returns True if the DEV flag is set. * @example npm run start -- isDev=1 * @example node dist/index.js isDev=1 */ export declare const isDev: () => boolean; /** Will be based on the local argument when this process was launched. * @returns True if the DEBUG flag is set. * @example npm run start -- isDebug=1 * @example node dist/index.js isDebug=1 */ export declare const isDebug: () => boolean; export { localNodeEnv, localAppEnv };