/dotenv-pre

Pre-configured `dotenv` module

Primary LanguageTypeScript

Pre-configured dotenv module

NPM version

Installation

npm i dotenv-pre -S

Usage

  • Use .env[.<name>] file(s) for default and .env[.<name>].local for local configurations.
  • Add .env[.<name>].local file(s) to .gitignore

Example without name

import 'dotenv-pre/config';

// ...

Example with name

import { config } from 'dotenv-pre';

config({
  name: 'api',
});

// ...

Files order

  • .env[.<name>].local (e.g. .env.api.local)
  • .env[.<name>] (e.g. .env.api)
  • .env.local
  • .env

License

MIT