﻿# config(path: ['.env.local', '.env'])

> Specify path(s) to multiple .env files

[Node](/docs/sdk/nodejs/)

```javascript
dotenvx.config(path: ['.env.local', '.env'])
```

## Usage

```dotenv
# .env.local
HELLO="Me"
```

```dotenv
# .env
HELLO="World"
```

```javascript
// index.js
require('@dotenvx/dotenvx').config({path: ['.env.local', '.env']})

console.log(`Hello ${process.env.HELLO}`)
```

```console
$ node index.js
⟐ injected env (1) from .env.local, .env
Hello Me
```

This is the equivalent of using `-f` from the command line.

To use a directory as the base for convention files, see [`config(path: directory, convention: 'nextjs')`](/docs/sdk/nodejs/config-path-directory-convention/).
