NordicSemiconductor / from-env-js

Helper function which ensures that required environment variables are set.

Home Page:https://github.com/NordicSemiconductor/from-env-js#readme

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fromEnv npm version

GitHub Actions semantic-release Renovate @commitlint/config-conventional code style: prettier ESLint: TypeScript

Helper function which ensures that required environment variables are set.

Example

import { fromEnv } from "@nordicsemiconductor/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 @nordicsemiconductor/from-env

Usage

See fromEnv.spec.ts.

About

Helper function which ensures that required environment variables are set.

https://github.com/NordicSemiconductor/from-env-js#readme

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:TypeScript 84.5%Language:JavaScript 15.5%