env-smart
Version:
Zero-dependency library for loading .env files. Supports default values and type definitions.
28 lines (27 loc) • 793 B
TypeScript
/// <reference types="node" />
/**
* Parse the contents of an env file
* @param {string} path - The path of the env file to parse
* @returns {object} - A key-value dictionary representation of the env file contents
*/
declare function parseFile(path: string, options?: {
verbose?: boolean;
encoding?: BufferEncoding;
inlineTypes?: boolean;
}): {
[key: string]: unknown;
} | undefined;
/**
* Parse a string of env formatted data
* @param {string} data - env data
* @returns {object} - A key-value dictionary representation of the env file contents
*/
declare function parse(data: string, options?: {
verbose?: boolean;
inlineTypes?: boolean;
lowercase?: boolean;
uppercase?: boolean;
}): {
[key: string]: unknown;
};
export { parse, parseFile };