You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can use the `--require` (`-r`) [command line option](https://nodejs.org/api/cli.html#cli_r_require_module) to preload dotenv. By doing this, you do not need to require and load dotenv in your application code. This is the preferred approach when using `import` instead of `require`.
- whitespace is removed from both ends of unquoted values (see more on [`trim`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim)) (`FOO= some value ` becomes `{FOO: 'some value'}`)
253
+
- single and double quoted values are escaped (`SINGLE_QUOTE='quoted'` becomes `{SINGLE_QUOTE: "quoted"}`)
254
+
- single and double quoted values maintain whitespace from both ends (`FOO=" some value "` becomes `{FOO: ' some value '}`)
255
+
- double quoted values expand new lines. Example: `MULTILINE="new\nline"` becomes
256
+
257
+
```
258
+
{MULTILINE: 'new
259
+
line'}
260
+
```
261
+
- multi-line values with line breaks are supported for quoted values if using the `{ multiline: "line-break" }` option.
262
+
In this mode you do not need to use `\n` to separate lines. Example:
263
+
264
+
```
265
+
PRIVATE_KEY="-----BEGIN PRIVATE KEY-----
266
+
MIGT...
267
+
7ure...
268
+
-----END PRIVATE KEY-----"
269
+
```
270
+
271
+
Note that when using this option, all values that start with quotes must end in quotes.
0 commit comments