perfect-env

1.0.1 • Public • Published

perfect.env

Build Status Coverage Status

Drop-in replacement for process.env that throws an Error if an unset environment variable is accessed.

const perfect = require('perfect-env')
 
const { PORT, CONSUMER_KEY, CONSUMER_SECRET, APP_URL } = perfect.env

instead of

const { PORT, CONSUMER_KEY, CONSUMER_SECRET, APP_URL } = process.env

Exception example:

Error: 'PORT' environment variable is not set.
    at Object.get (your-project-path/node_modules/perfect-env/index.js:6:15)
    at Object.<anonymous> (your-project-path/index.js:3:9)

License

MIT © David da Silva

Dependencies (0)

    Dev Dependencies (5)

    Package Sidebar

    Install

    npm i perfect-env

    Weekly Downloads

    0

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • dasilvacontin