@code-like-a-carpenter/dotenv
TypeScript icon, indicating that this package has built-in type declarations

2.2.5 • Public • Published

@code-like-a-carpenter/dotenv

standard-readme compliant

Wrapper around dotenv the loads the right .env file(s) based on the NODE_ENV

Table of Contents

Install

npm i @code-like-a-carpenter/dotenv

Usage

This package uses the dotenv package under the hood, but, depending on NODE_ENV, will load more files than just the default .env.

Each of the following files will be loaded if they exist, in the following order. Files loaded earlier take precedence.

  • .env.<env>.local
  • .env.local
  • .env.<env>
  • .env

There are only three valid values for <env>, based on the value of NODE_ENV:

NODE_ENV <env>
production production
test test
anything else development

Please add the following to your gitignore. local env files are intended for customizing the environment on your local machine and should not be checked into git.

.env.local
.env.*.local
.env.production

Even though you may check env files into git, you still shouldn't check in secrets.

Maintainer

Ian Remmel

Contributing

Please see contributing guidelines at the project homepage.

License

MIT © Ian Remmel 2023 until at least now

Readme

Keywords

none

Package Sidebar

Install

npm i @code-like-a-carpenter/dotenv

Weekly Downloads

7

Version

2.2.5

License

MIT

Unpacked Size

34.9 kB

Total Files

18

Last publish

Collaborators

  • ianwremmel