Skip to content

Commit 69ff042

Browse files
committed
update README
1 parent 170c345 commit 69ff042

File tree

1 file changed

+3
-47
lines changed

1 file changed

+3
-47
lines changed

README.md

Lines changed: 3 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,13 @@
22

33
<img src="https://raw.githubusercontent.com/motdotla/dotenv/master/dotenv.svg" alt="dotenv" align="right" width="200" />
44

5-
> Dotenv is a zero-dependency module that loads environment variables from a `.env` file into [`process.env`](https://nodejs.org/docs/latest/api/process.html#process_process_env). Storing configuration in the environment separate from code is based on [The Twelve-Factor App](https://12factor.net/config) methodology.
6-
>
7-
> [2 minute tutorial 📺](https://www.youtube.com/watch?v=YtkZR0NFd1g)
5+
Dotenv is a zero-dependency module that loads environment variables from a `.env` file into [`process.env`](https://nodejs.org/docs/latest/api/process.html#process_process_env). Storing configuration in the environment separate from code is based on [The Twelve-Factor App](https://12factor.net/config) methodology.
86

9-
* [usage](#usage)
10-
* [environments](#multiple-environments)
11-
* [deploying](#deploying)
12-
* [agents 🆕](#agents-as2)
7+
[Watch the tutorial](https://www.youtube.com/watch?v=YtkZR0NFd1g)
138

149
&nbsp;
1510

16-
### Usage
11+
## Usage
1712

1813
Install it.
1914

@@ -226,45 +221,6 @@ You need to deploy your secrets in a cloud-agnostic manner? Use [dotenvx](https:
226221

227222
</details>
228223

229-
Create a `.env` file in the root of your project (if using a monorepo structure like `apps/backend/app.js`, put it in the root of the folder where your `app.js` process runs):
230-
231-
```ini
232-
S3_BUCKET="YOURS3BUCKET"
233-
SECRET_KEY="YOURSECRETKEYGOESHERE"
234-
```
235-
236-
As early as possible in your application, import and configure dotenv:
237-
238-
```javascript
239-
require('dotenv').config()
240-
console.log(process.env) // remove this after you've confirmed it is working
241-
```
242-
243-
.. [or using ES6?](#how-do-i-use-dotenv-with-import)
244-
245-
```javascript
246-
import 'dotenv/config'
247-
```
248-
249-
ES6 import if you need to set config options:
250-
251-
```javascript
252-
import dotenv from 'dotenv'
253-
254-
dotenv.config({ path: '/custom/path/to/.env' })
255-
```
256-
257-
That's it. `process.env` now has the keys and values you defined in your `.env` file:
258-
259-
```javascript
260-
require('dotenv').config()
261-
// or import 'dotenv/config' if you're using ES6
262-
263-
...
264-
265-
s3.getBucketCors({Bucket: process.env.S3_BUCKET}, function(err, data) {})
266-
```
267-
268224
&nbsp;
269225

270226
## Multiple Environments

0 commit comments

Comments
 (0)