@nitra/check-env
Version:
Check that the critical environment variables are set
42 lines (30 loc) • 1.4 kB
Markdown
# `check-env`
Check that the critical environment variables are set for your app,
and that you did not leave dangerous development overrides in production.
[](https://www.npmjs.com/package/@nitra/check-env)
[](https://github.com/47ng/check-env/blob/next/LICENSE)
[](https://github.com/47ng/check-env/actions)
[](https://coveralls.io/github/47ng/check-env?branch=next)
## Installation
```bash
yarn add @nitra/check-env
```
## Usage
```js
import checkEnv from '@nitra/check-env'
checkEnv(
// Will log an error and throw if any of these are missing:
[
'SOME_API_SECRET',
'PRIVATE_TOKEN',
'SOME_OTHER_IMPORTANT_THING'
// ...
]
)
```
If some required environment variable are not set, it will tell you and throw
an error at the end:

## License
[MIT](https://github.com/47ng/check-env/blob/master/LICENSE) - Made with ❤️ by [François Best](https://francoisbest.com)
Using this package at work ? [Sponsor me](https://github.com/sponsors/franky47) to help with support and maintenance.