Helper function which ensures that required environment variables are set.
import { fromEnv } from "@bifravst/from-env";
const { env } = fromEnv({
env: "MY_ENV",
})(process.env);
This will throw an exception if MY_ENV
is not set on process.env
. Otherwise,
env
will not contain the value of process.env.MY_ENV
.
npm i --save-dev --save-exact @bifravst/from-env
See fromEnv.spec.ts
.