2.0.1 • Published 5 years ago

@kth/reqvars v2.0.1

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

Build Status

reqvars

Check that process.env contains all the required variables!

Install

npm i @kth/reqvars

Usage

  1. Write a .env.in saying which environmental variables are required in your program. This will be your specification file.

For example:

DB_HOST=localhost
DB_USER=root
DB_PASS=

If you commit the file (which is recommended) remember to leave the secrets (passwords, etc.) blank

  1. As early as possible in your application, require and call check:

    require('@kth/reqvars').check()

    It will throw an error if some variable is missing

  2. If you want to use another path, pass it as argument:

    require('@kth/reqvars').check('./requirements.conf')
2.0.1

5 years ago

2.0.0

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago