@d3vtool/strict-env
Version:
A utility to automatically load and validate environment variables from `.env` files, ensuring they're properly configured before your system starts.
16 lines (15 loc) • 1.01 kB
TypeScript
/**
* Sets up environment configuration by loading environment files.
* If a specific file is provided in the options, it will load that file.
* Otherwise, it will attempt to load from a predefined list of accepted environment files.
*
* @param {string} [currentWD=process.cwd()] - The current working directory. Defaults to the current process working directory.
* @param {Object} [options] - Optional configuration for environment setup.
* @param {string} [options.file] - The specific `.env` file to load. If not provided, a default set of files will be used in order of precedence.
* @param {string} [options.encoding="utf8"] - The file encoding to use when reading `.env` files.
* @param {Object | ObjectValidator } [options.validators] - A list of validator object key-value to apply to the environment variables once loaded. Optional.
*
* @returns {void} This function does not return a value.
*/
declare function tsetup(currentWD?: string, options?: undefined): void;
export { tsetup };