JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4850
  • Score
    100M100P100Q127803F
  • License MIT

A lightweight utility to check an .env file for the presence and validity of environment variables, as specified via a template file or the command line.

Package Exports

  • validate-env-vars

Readme

validate-env-vars

license latest last commit npm downloads
Coverage Code Quality CodeQL TypeScript Version

A lightweight utility to check an .env file for the presence and validity of environment variables, as specified via a template file or the command line

Installation

Using npm:

npm install validate-env-vars --save-dev

Usage

Check your .env file against every required variable in your template file:

validate-env-vars --template .env.template

Check your .env file against a list of required variables:

validate-env-vars --list VAR1,VAR2,VAR3

Check a specific .env file:

validate-env-vars --env .env.local --template .env.template

Arguments

Argument Description
-t <file>
--template <file>
Path to template file to check against. Optional variables can be specified with # optional suffix.
Either --template or --list must be specified.
-l <vars>
--list <vars>
Comma-separated list of required variables to check for.
Either --template or --list must be specified.
-e <file>
--env <file>
Path to .env file to check. Defaults to .env in current directory.