@bifravst/from-env
v4.0.0
Published
Helper function which ensures that required environment variables are set.
Downloads
5,007
Readme
fromEnv 
Helper function which ensures that required environment variables are set.
Example
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.
Installation
npm i --save-dev --save-exact @bifravst/from-envUsage
See fromEnv.spec.ts.
Node & NPM
This project requires Node.js >=24.19.0 <25 and npm >=12.0.2 <13 (enforced
via check-node-version on npm install and npm ci).
The check is skipped during npm publish and npm pack, because
semantic-release bundles its own npm (@semantic-release/npm depends on
npm@^11.6.2) and runs the publish with that version rather than the one
installed in CI.
