0.0.1 • Published 5 years ago

@zhaoyao91/check-env v0.0.1

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

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

0.0.1

5 years ago

0.0.0

5 years ago