UNPKG

@nitra/check-env

Version:

Check that the critical environment variables are set

42 lines (30 loc) 1.4 kB
# `check-env` Check that the critical environment variables are set for your app, and that you did not leave dangerous development overrides in production. [![NPM](https://img.shields.io/npm/v/@nitra/check-env?color=red)](https://www.npmjs.com/package/@nitra/check-env) [![MIT License](https://img.shields.io/github/license/47ng/check-env.svg?color=blue)](https://github.com/47ng/check-env/blob/next/LICENSE) [![Continuous Integration](https://github.com/47ng/check-env/workflows/Continuous%20Integration/badge.svg?branch=next)](https://github.com/47ng/check-env/actions) [![Coverage Status](https://coveralls.io/repos/github/47ng/check-env/badge.svg?branch=next)](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: !["CLI output"](output.png) ## 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.