@boost/config
Version:
Powerful convention based finder, loader, and manager of both configuration and ignore files.
10 lines (9 loc) • 343 B
JavaScript
/**
* Detect the current environment name from `<project>_ENV` and `NODE_ENV`.
*/
function getEnv(name) {
const constName = name.replace(/[A-Z]/gu, char => `_${char}`).toUpperCase();
return (process.env[`${constName}_ENV`] ?? process.env.NODE_ENV ?? 'development').toLowerCase();
}
export { getEnv };
//# sourceMappingURL=getEnv.mjs.map