Skip to content

Commit a98ba56

Browse files
committed
update README
1 parent 691509a commit a98ba56

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,18 @@ Unless you encrypt it with [dotenvx](https://github.com/dotenvx/dotenvx). Then w
545545
Use [dotenvx](https://github.com/dotenvx/dotenvx).
546546

547547
</details>
548+
<details><summary>Should I have multiple `.env` files?</summary><br/>
549+
550+
We recommend creating one `.env` file per environment. Use `.env` for local/development, `.env.production` for production and so on. This still follows the twelve factor principles as each is attributed individually to its own environment. Avoid custom set ups that work in inheritance somehow (`.env.production` inherits values form `.env` for example). It is better to duplicate values if necessary across each `.env.environment` file.
551+
552+
> In a twelve-factor app, env vars are granular controls, each fully orthogonal to other env vars. They are never grouped together as “environments”, but instead are independently managed for each deploy. This is a model that scales up smoothly as the app naturally expands into more deploys over its lifetime.
553+
>
554+
> [The Twelve-Factor App](http://12factor.net/config)
555+
556+
Additionally, we recommend using [dotenvx](https://github.com/dotenvx/dotenvx) to encrypt and manage these.
557+
558+
</details>
559+
548560
<details><summary>How do I use dotenv with `import`?</summary><br/>
549561

550562
Simply..
@@ -602,17 +614,6 @@ There are two alternatives to this approach:
602614
2. Create a separate file that will execute `config` first as outlined in [this comment on #133](https://github.com/motdotla/dotenv/issues/133#issuecomment-255298822)
603615
</details>
604616

605-
<details><summary>Should I have multiple `.env` files?</summary><br/>
606-
607-
We recommend creating one `.env` file per environment. Use `.env` for local/development, `.env.production` for production and so on. This still follows the twelve factor principles as each is attributed individually to its own environment. Avoid custom set ups that work in inheritance somehow (`.env.production` inherits values form `.env` for example). It is better to duplicate values if necessary across each `.env.environment` file.
608-
609-
> In a twelve-factor app, env vars are granular controls, each fully orthogonal to other env vars. They are never grouped together as “environments”, but instead are independently managed for each deploy. This is a model that scales up smoothly as the app naturally expands into more deploys over its lifetime.
610-
>
611-
> [The Twelve-Factor App](http://12factor.net/config)
612-
613-
Additionally, we recommend using [dotenvx](https://github.com/dotenvx/dotenvx) to encrypt and manage these.
614-
615-
</details>
616617
<details><summary>Can I customize/write plugins for dotenv?</summary><br/>
617618

618619
Yes! `dotenv.config()` returns an object representing the parsed `.env` file. This gives you everything you need to continue setting values on `process.env`. For example:

0 commit comments

Comments
 (0)