@kth/reqvars

2.0.1 • Public • Published

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')

Readme

Keywords

none

Package Sidebar

Install

npm i @kth/reqvars

Weekly Downloads

105

Version

2.0.1

License

MIT

Unpacked Size

4.24 kB

Total Files

7

Last publish

Collaborators

  • kth-stratus
  • mictsi
  • n_sandstrom
  • kthwebmaster
  • exacs
  • ssundkvist
  • kth-ci
  • emilstenberg