Added helper for env-vars
parent
7562ff2268
commit
184432f642
@ -0,0 +1,13 @@
|
||||
function requireEnvVars(requiredEnv){
|
||||
// Ensure required ENV vars are set
|
||||
let unsetEnv = requiredEnv.filter((env) => !(typeof process.env[env] !== 'undefined'));
|
||||
|
||||
if (unsetEnv.length > 0) {
|
||||
return "Required ENV variables are not set: [" + unsetEnv.join(', ') + "]";
|
||||
}
|
||||
}
|
||||
|
||||
// Specify exports
|
||||
module.exports = {
|
||||
requireEnvVars
|
||||
};
|
Loading…
Reference in New Issue