@nordicsemiconductor/from-env
TypeScript icon, indicating that this package has built-in type declarations

3.0.1 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i @nordicsemiconductor/from-env

Weekly Downloads

1,147

Version

3.0.1

License

BSD-3-Clause

Unpacked Size

6.38 kB

Total Files

9

Last publish

Collaborators

  • aadnekar
  • ken.redergard
  • bencefr
  • bihanssen
  • nordicsemi
  • asset-tracker-cloud-ci
  • chfa.nordicsemi.no