chickenv
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

🐥env, 🐔v

Ensure environment variables are set at both runtime and compile-time. TypeScript users benefit from auto-completion of variables.

Installation

$ yarn add chickenv

Examples

If environment variables are not set, the method will throw.

import chick from 'chickenv'

// throws if missing
const env = chick.check(
    process.env,
    ['FOO', 'BAR', 'BAZ']
)

env.FOO // guaranteed to be set

Alternative assertion method.

import chicken from 'chickenv'

chicken.assert(process.env, ['FOO', 'BAR', 'BAZ'])

process.env.FOO

Need more?

If you need more advanced features, you should probably take a look at other libraries, such as runtypes.

Pronunciation

Art is in the eye of the beholder

Pronounced chick-env (🐤env), or chicken-v (🐔v).

License

MIT © Vladimirs Nordholm

Readme

Keywords

none

Package Sidebar

Install

npm i chickenv

Weekly Downloads

694

Version

1.0.0

License

MIT

Unpacked Size

21.7 kB

Total Files

20

Last publish

Collaborators

  • vladdesv