Skip to content

Commit d123bb6

Browse files
committed
Add documentation of multiline line break parsing
1 parent 4e3e3b5 commit d123bb6

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

README.md

+40
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,27 @@ Override any environment variables that have already been set on your machine wi
161161
require('dotenv').config({ override: true })
162162
```
163163

164+
##### Multiline
165+
166+
Default: `false`
167+
168+
Turn on multiline line break parsing.
169+
170+
```js
171+
require('dotenv').config({ multiline: true })
172+
```
173+
174+
This allows specifying multiline values in this format:
175+
176+
```
177+
PRIVATE_KEY="-----BEGIN PRIVATE KEY-----
178+
MIGT...
179+
7ure...
180+
-----END PRIVATE KEY-----"
181+
```
182+
183+
Ensure that the value begins with a single or double quote character, and it ends with the same character.
184+
164185
### Parse
165186

166187
The engine which parses the contents of your file containing environment
@@ -190,6 +211,25 @@ const config = dotenv.parse(buf, opt)
190211
// expect a debug message because the buffer is not in KEY=VAL form
191212
```
192213

214+
##### Multiline
215+
216+
Default: `false`
217+
218+
Turn on multiline line break parsing.
219+
220+
```js
221+
require('dotenv').config({ multiline: true })
222+
```
223+
224+
This allows specifying multiline values in this format:
225+
226+
```
227+
PRIVATE_KEY="-----BEGIN PRIVATE KEY-----
228+
MIGT...
229+
7ure...
230+
-----END PRIVATE KEY-----"
231+
```
232+
193233
## Other Usage
194234

195235
### Preload

0 commit comments

Comments
 (0)