@zhaoyao91/check-env

0.0.1 • Public • Published

Check Env

Check environment variables.

Install

npm i @zhaoyao91/check-env

Usage

const checkEnv = require("@zhaoyao91/check-env");

const env = checkEnv({
  SOME_ENV: {
    optional: true,                   // ?= false
    default: "some-value",            // ?= undefined
    checkIn: x => x !== "bad-value",  // ?= alwaysTrue
    map: x => x.split("-"),           // ?= identity
    checkOut: x => x.length > 1       // ?= alwaysTrue
  }

  // OTHER_ENV: ...
});

// env is {SOME_VALUE: ['some', 'value']}

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i @zhaoyao91/check-env

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

4.08 kB

Total Files

4

Last publish

Collaborators

  • zhaoyao91