Skip to content

perf: ~2x faster parse() via hand-written character scanner - #1010

Merged
motdotla merged 2 commits into
motdotla:clifrom
homanp:perf/parser-char-scanner
Jul 31, 2026
Merged

motdotla merged 2 commits into
motdotla:clifrom
homanp:perf/parser-char-scanner

Conversation

@homanp

@homanp homanp commented Apr 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Swaps the LINE regex in parse() for a hand-rolled character scanner with a Uint8Array(256) lookup table for key chars. About 2x faster on real .env files. Same behavior, same API, still zero deps.

Benchmarks

Repro:

node tests/test-parse-perf.js

5000 parses of a 200-line .env, median of 7 runs, three fresh node processes per side (Node 23, macOS):

run 1 run 2 run 3
master 121.21 ms 121.77 ms 122.85 ms
this PR 57.86 ms 58.71 ms 58.26 ms

~2.1x speedup, variance under 2% on both sides. Also tried it against a realistic ~50-key production-style .env (db, auth, aws, flags) — similar story, roughly 1.9x.

What changed

The regex was the bottleneck. Replaced it with a single pass over the string using charCodeAt:

  • Uint8Array(256) built at module load tells us in O(1) whether a byte is a valid key char ([A-Za-z0-9._-]).
  • For unquoted values, indexOf finds the \n / # boundaries — V8's indexOf is way faster than walking char by char.
  • CR normalization only runs when there's actually a \r in the input, instead of always.

Tests

Existing test suite passes. I also diffed output against master across a bunch of edge cases I was worried about and got byte-identical results: escaped quotes inside double quotes, unterminated quotes, KEY: value (yaml-style), export KEY=..., multiline values with \n escapes, inline comments after quoted values, KEY==value, KEY=val#notcomment, KEY=#nothing, leading/trailing whitespace, \r line endings, empty input, comment-only input.

Happy to add any of those as actual TAP cases if you'd like them in the suite.

Notes

No API changes, no behavior changes, no new deps.

homanp added 2 commits April 15, 2026 19:32
Reproduces with: node tests/test-parse-perf.js
Reports median of 7 runs of 5000 parse() calls on a 200-line .env.
The line-matching regex in parse() is the dominant cost when parsing
large .env files. Replaces it with a Uint8Array(256) lookup table for
key character classification and a manual state machine over the
input string. indexOf() is used to find the end of unquoted values
and newline boundaries.

Behavior is preserved across the existing test suite and 24 additional
edge cases (escaped quotes inside double quotes, unterminated quotes,
yaml-style 'KEY: value', export prefix, multiline values, inline
comments, KEY==value, etc.).

No new dependencies. No changes to public API.
@motdotla

Copy link
Copy Markdown
Owner

@homanp wow, one of the most interesting contributions to dotenv in a decade.

Give me time on this one to consider the maintenance cost here. It's much less readable, but it is very interesting.

@homanp

homanp commented Apr 15, 2026

Copy link
Copy Markdown
Contributor Author

@homanp wow, one of the most interesting contributions to dotenv in a decade.

Give me time on this one to consider the maintenance cost here. It's much less readable, but it is very interesting.

Thank you, happy to contribute. I have some other ideas as well for cold boot but haven't tested them yet.

Open to feedback on this PR. Happy to make optimizations based on your thoughts

Repository owner deleted a comment from lolusiayy Apr 21, 2026
motdotla added a commit that referenced this pull request Jul 31, 2026
perf: ~2x faster parse() via hand-written character scanner

Keep the classic regex parser as default and expose #1010's scanner
behind parse(src, { fast: true }) / config({ fast: true }).

Co-authored-by: Cursor <cursoragent@cursor.com>
@motdotla
motdotla changed the base branch from master to cli July 31, 2026 01:23
@motdotla
motdotla merged commit e8f9b1e into motdotla:cli Jul 31, 2026
OIRNOIR pushed a commit to OIRNOIR/YouTube-Helper-Server that referenced this pull request Sep 25, 2026
This PR contains the following updates:

| Package | Type | Update | Change | Pending |
|---|---|---|---|---|
| [dotenv](https://github.com/motdotla/dotenv) | imports | major | [`17.4.2` -> `18.0.0`](https://renovatebot.com/diffs/npm/dotenv/17.4.2/18.0.0) | `18.0.3` (+2) |

---

### Release Notes

<details>
<summary>motdotla/dotenv (dotenv)</summary>

### [`v18.0.0`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1800-2026-09-17)

[Compare Source](motdotla/dotenv@v17.4.2...v18.0.0)

##### Added

- NEW: Dotenv now has a CLI. ([#&#8203;1022](motdotla/dotenv#1022))

```sh
$ dotenv run -- node index.js
◇ injected env (2) from .env
Hello Dotenv
```

- NEW: Dotenv now has a fast parser thanks to [@&#8203;homanp](https://github.com/homanp) of [superagent.sh](https://superagent.sh). Pass `config({ fast: true })`, flag `--fast`, or set `DOTENV_FAST=true` to opt-in to \~2x faster character-scanner parser. ([#&#8203;1010](motdotla/dotenv#1010))

```sh
$ dotenv run --fast -- node index.js
◇ injected env (2) from .env
Hello Dotenv
```

##### Changed

- Injecting message sent to stderr rather than stdout and tips removed ([#&#8203;1037](motdotla/dotenv#1037))

##### Removed

- Remove tips ([#&#8203;1031](motdotla/dotenv#1031))
- Remove skill files ([#&#8203;1032](motdotla/dotenv#1032))
- Remove Spanish README ([#&#8203;1034](motdotla/dotenv#1034))
- Remove .env.vault support ([#&#8203;1033](motdotla/dotenv#1033))
- Remove preloading. Instead use cli `dotenv run -- your-command` ([#&#8203;1035](motdotla/dotenv#1035))

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xMDUuNCIsInVwZGF0ZWRJblZlciI6IjQ0LjEwNS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Reviewed-on: https://git.oirnoir.dev/OIRNOIR/YouTube-Helper-Server/pulls/46
renovate Bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Oct 2, 2026
| datasource | package | from   | to     |
| ---------- | ------- | ------ | ------ |
| npm        | dotenv  | 17.4.2 | 18.0.5 |


## [v18.0.5](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1805-2026-09-30)

##### Changed

- Fix missing typescript module declaration ([#1068](motdotla/dotenv#1068))
- Improve performance for large .env files ([#1066](motdotla/dotenv#1066))


## [v18.0.4](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1804-2026-09-25)

##### Changed

- `import dotenv/config` should default quiet: true ([#1063](motdotla/dotenv#1063))


## [v18.0.3](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1803-2026-09-22)

##### Changed

- Patch `DOTENV_QUIET` setting when inside .env file ([#1059](motdotla/dotenv#1059))


## [v18.0.2](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1802-2026-09-21)

- Patch additional edge cases for the fast parser ([#1056](motdotla/dotenv#1056))


## [v18.0.1](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1801-2026-09-18)

##### Changed

- Handle file urls in config logging ([#1054](motdotla/dotenv#1054))


## [v18.0.0](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1800-2026-09-17)

##### Added

- NEW: Dotenv now has a CLI. ([#1022](motdotla/dotenv#1022))

```sh
$ dotenv run -- node index.js
◇ injected env (2) from .env
Hello Dotenv
```

- NEW: Dotenv now has a fast parser thanks to [@homanp](https://github.com/homanp) of [superagent.sh](https://superagent.sh). Pass `config({ fast: true })`, flag `--fast`, or set `DOTENV_FAST=true` to opt-in to \~2x faster character-scanner parser. ([#1010](motdotla/dotenv#1010))

```sh
$ dotenv run --fast -- node index.js
◇ injected env (2) from .env
Hello Dotenv
```

##### Changed

- Injecting message sent to stderr rather than stdout and tips removed ([#1037](motdotla/dotenv#1037))

##### Removed

- Remove tips ([#1031](motdotla/dotenv#1031))
- Remove skill files ([#1032](motdotla/dotenv#1032))
- Remove Spanish README ([#1034](motdotla/dotenv#1034))
- Remove .env.vault support ([#1033](motdotla/dotenv#1033))
- Remove preloading. Instead use cli `dotenv run -- your-command` ([#1035](motdotla/dotenv#1035))
renovate Bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Oct 2, 2026
| datasource | package | from   | to     |
| ---------- | ------- | ------ | ------ |
| npm        | dotenv  | 17.4.2 | 18.0.5 |


## [v18.0.5](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1805-2026-09-30)

##### Changed

- Fix missing typescript module declaration ([#1068](motdotla/dotenv#1068))
- Improve performance for large .env files ([#1066](motdotla/dotenv#1066))


## [v18.0.4](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1804-2026-09-25)

##### Changed

- `import dotenv/config` should default quiet: true ([#1063](motdotla/dotenv#1063))


## [v18.0.3](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1803-2026-09-22)

##### Changed

- Patch `DOTENV_QUIET` setting when inside .env file ([#1059](motdotla/dotenv#1059))


## [v18.0.2](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1802-2026-09-21)

- Patch additional edge cases for the fast parser ([#1056](motdotla/dotenv#1056))


## [v18.0.1](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1801-2026-09-18)

##### Changed

- Handle file urls in config logging ([#1054](motdotla/dotenv#1054))


## [v18.0.0](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1800-2026-09-17)

##### Added

- NEW: Dotenv now has a CLI. ([#1022](motdotla/dotenv#1022))

```sh
$ dotenv run -- node index.js
◇ injected env (2) from .env
Hello Dotenv
```

- NEW: Dotenv now has a fast parser thanks to [@homanp](https://github.com/homanp) of [superagent.sh](https://superagent.sh). Pass `config({ fast: true })`, flag `--fast`, or set `DOTENV_FAST=true` to opt-in to \~2x faster character-scanner parser. ([#1010](motdotla/dotenv#1010))

```sh
$ dotenv run --fast -- node index.js
◇ injected env (2) from .env
Hello Dotenv
```

##### Changed

- Injecting message sent to stderr rather than stdout and tips removed ([#1037](motdotla/dotenv#1037))

##### Removed

- Remove tips ([#1031](motdotla/dotenv#1031))
- Remove skill files ([#1032](motdotla/dotenv#1032))
- Remove Spanish README ([#1034](motdotla/dotenv#1034))
- Remove .env.vault support ([#1033](motdotla/dotenv#1033))
- Remove preloading. Instead use cli `dotenv run -- your-command` ([#1035](motdotla/dotenv#1035))
renovate Bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Oct 3, 2026
| datasource | package | from   | to     |
| ---------- | ------- | ------ | ------ |
| npm        | dotenv  | 17.4.2 | 18.0.5 |


## [v18.0.5](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1805-2026-09-30)

##### Changed

- Fix missing typescript module declaration ([#1068](motdotla/dotenv#1068))
- Improve performance for large .env files ([#1066](motdotla/dotenv#1066))


## [v18.0.4](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1804-2026-09-25)

##### Changed

- `import dotenv/config` should default quiet: true ([#1063](motdotla/dotenv#1063))


## [v18.0.3](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1803-2026-09-22)

##### Changed

- Patch `DOTENV_QUIET` setting when inside .env file ([#1059](motdotla/dotenv#1059))


## [v18.0.2](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1802-2026-09-21)

- Patch additional edge cases for the fast parser ([#1056](motdotla/dotenv#1056))


## [v18.0.1](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1801-2026-09-18)

##### Changed

- Handle file urls in config logging ([#1054](motdotla/dotenv#1054))


## [v18.0.0](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1800-2026-09-17)

##### Added

- NEW: Dotenv now has a CLI. ([#1022](motdotla/dotenv#1022))

```sh
$ dotenv run -- node index.js
◇ injected env (2) from .env
Hello Dotenv
```

- NEW: Dotenv now has a fast parser thanks to [@homanp](https://github.com/homanp) of [superagent.sh](https://superagent.sh). Pass `config({ fast: true })`, flag `--fast`, or set `DOTENV_FAST=true` to opt-in to \~2x faster character-scanner parser. ([#1010](motdotla/dotenv#1010))

```sh
$ dotenv run --fast -- node index.js
◇ injected env (2) from .env
Hello Dotenv
```

##### Changed

- Injecting message sent to stderr rather than stdout and tips removed ([#1037](motdotla/dotenv#1037))

##### Removed

- Remove tips ([#1031](motdotla/dotenv#1031))
- Remove skill files ([#1032](motdotla/dotenv#1032))
- Remove Spanish README ([#1034](motdotla/dotenv#1034))
- Remove .env.vault support ([#1033](motdotla/dotenv#1033))
- Remove preloading. Instead use cli `dotenv run -- your-command` ([#1035](motdotla/dotenv#1035))
renovate Bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Oct 4, 2026
| datasource | package | from   | to     |
| ---------- | ------- | ------ | ------ |
| npm        | dotenv  | 17.4.2 | 18.0.5 |


## [v18.0.5](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1805-2026-09-30)

##### Changed

- Fix missing typescript module declaration ([#1068](motdotla/dotenv#1068))
- Improve performance for large .env files ([#1066](motdotla/dotenv#1066))


## [v18.0.4](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1804-2026-09-25)

##### Changed

- `import dotenv/config` should default quiet: true ([#1063](motdotla/dotenv#1063))


## [v18.0.3](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1803-2026-09-22)

##### Changed

- Patch `DOTENV_QUIET` setting when inside .env file ([#1059](motdotla/dotenv#1059))


## [v18.0.2](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1802-2026-09-21)

- Patch additional edge cases for the fast parser ([#1056](motdotla/dotenv#1056))


## [v18.0.1](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1801-2026-09-18)

##### Changed

- Handle file urls in config logging ([#1054](motdotla/dotenv#1054))


## [v18.0.0](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1800-2026-09-17)

##### Added

- NEW: Dotenv now has a CLI. ([#1022](motdotla/dotenv#1022))

```sh
$ dotenv run -- node index.js
◇ injected env (2) from .env
Hello Dotenv
```

- NEW: Dotenv now has a fast parser thanks to [@homanp](https://github.com/homanp) of [superagent.sh](https://superagent.sh). Pass `config({ fast: true })`, flag `--fast`, or set `DOTENV_FAST=true` to opt-in to \~2x faster character-scanner parser. ([#1010](motdotla/dotenv#1010))

```sh
$ dotenv run --fast -- node index.js
◇ injected env (2) from .env
Hello Dotenv
```

##### Changed

- Injecting message sent to stderr rather than stdout and tips removed ([#1037](motdotla/dotenv#1037))

##### Removed

- Remove tips ([#1031](motdotla/dotenv#1031))
- Remove skill files ([#1032](motdotla/dotenv#1032))
- Remove Spanish README ([#1034](motdotla/dotenv#1034))
- Remove .env.vault support ([#1033](motdotla/dotenv#1033))
- Remove preloading. Instead use cli `dotenv run -- your-command` ([#1035](motdotla/dotenv#1035))
renovate Bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Oct 6, 2026
| datasource | package | from   | to     |
| ---------- | ------- | ------ | ------ |
| npm        | dotenv  | 17.4.2 | 18.0.6 |


## [v18.0.6](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1806-2026-10-06)

##### Changed

- Use smarter `parseBoolean` not Boolean() to fix override ([#1069](motdotla/dotenv#1069))


## [v18.0.5](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1805-2026-09-30)

##### Changed

- Fix missing typescript module declaration ([#1068](motdotla/dotenv#1068))
- Improve performance for large .env files ([#1066](motdotla/dotenv#1066))


## [v18.0.4](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1804-2026-09-25)

##### Changed

- `import dotenv/config` should default quiet: true ([#1063](motdotla/dotenv#1063))


## [v18.0.3](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1803-2026-09-22)

##### Changed

- Patch `DOTENV_QUIET` setting when inside .env file ([#1059](motdotla/dotenv#1059))


## [v18.0.2](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1802-2026-09-21)

##### Changed

- Patch additional edge cases for the fast parser ([#1056](motdotla/dotenv#1056))


## [v18.0.1](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1801-2026-09-18)

##### Changed

- Handle file urls in config logging ([#1054](motdotla/dotenv#1054))


## [v18.0.0](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1800-2026-09-17)

##### Added

- NEW: Dotenv now has a CLI. ([#1022](motdotla/dotenv#1022))

```sh
$ dotenv run -- node index.js
◇ injected env (2) from .env
Hello Dotenv
```

- NEW: Dotenv now has a fast parser thanks to [@homanp](https://github.com/homanp) of [superagent.sh](https://superagent.sh). Pass `config({ fast: true })`, flag `--fast`, or set `DOTENV_FAST=true` to opt-in to \~2x faster character-scanner parser. ([#1010](motdotla/dotenv#1010))

```sh
$ dotenv run --fast -- node index.js
◇ injected env (2) from .env
Hello Dotenv
```

[faster than Node native parseEnv!](https://dotenvx.com/blog/2026/09/28/dotenv-fast.html)

##### Changed

- Injecting message sent to stderr rather than stdout and tips removed ([#1037](motdotla/dotenv#1037))

##### Removed

- Remove tips ([#1031](motdotla/dotenv#1031))
- Remove skill files ([#1032](motdotla/dotenv#1032))
- Remove Spanish README ([#1034](motdotla/dotenv#1034))
- Remove .env.vault support ([#1033](motdotla/dotenv#1033))
- Remove preloading. Instead use cli `dotenv run -- your-command` ([#1035](motdotla/dotenv#1035))
renovate Bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Oct 6, 2026
| datasource | package | from   | to     |
| ---------- | ------- | ------ | ------ |
| npm        | dotenv  | 17.4.2 | 18.0.6 |


## [v18.0.6](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1806-2026-10-06)

##### Changed

- Use smarter `parseBoolean` not Boolean() to fix override ([#1069](motdotla/dotenv#1069))


## [v18.0.5](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1805-2026-09-30)

##### Changed

- Fix missing typescript module declaration ([#1068](motdotla/dotenv#1068))
- Improve performance for large .env files ([#1066](motdotla/dotenv#1066))


## [v18.0.4](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1804-2026-09-25)

##### Changed

- `import dotenv/config` should default quiet: true ([#1063](motdotla/dotenv#1063))


## [v18.0.3](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1803-2026-09-22)

##### Changed

- Patch `DOTENV_QUIET` setting when inside .env file ([#1059](motdotla/dotenv#1059))


## [v18.0.2](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1802-2026-09-21)

##### Changed

- Patch additional edge cases for the fast parser ([#1056](motdotla/dotenv#1056))


## [v18.0.1](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1801-2026-09-18)

##### Changed

- Handle file urls in config logging ([#1054](motdotla/dotenv#1054))


## [v18.0.0](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1800-2026-09-17)

##### Added

- NEW: Dotenv now has a CLI. ([#1022](motdotla/dotenv#1022))

```sh
$ dotenv run -- node index.js
◇ injected env (2) from .env
Hello Dotenv
```

- NEW: Dotenv now has a fast parser thanks to [@homanp](https://github.com/homanp) of [superagent.sh](https://superagent.sh). Pass `config({ fast: true })`, flag `--fast`, or set `DOTENV_FAST=true` to opt-in to \~2x faster character-scanner parser. ([#1010](motdotla/dotenv#1010))

```sh
$ dotenv run --fast -- node index.js
◇ injected env (2) from .env
Hello Dotenv
```

[faster than Node native parseEnv!](https://dotenvx.com/blog/2026/09/28/dotenv-fast.html)

##### Changed

- Injecting message sent to stderr rather than stdout and tips removed ([#1037](motdotla/dotenv#1037))

##### Removed

- Remove tips ([#1031](motdotla/dotenv#1031))
- Remove skill files ([#1032](motdotla/dotenv#1032))
- Remove Spanish README ([#1034](motdotla/dotenv#1034))
- Remove .env.vault support ([#1033](motdotla/dotenv#1033))
- Remove preloading. Instead use cli `dotenv run -- your-command` ([#1035](motdotla/dotenv#1035))
renovate Bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Oct 9, 2026
| datasource | package | from   | to     |
| ---------- | ------- | ------ | ------ |
| npm        | dotenv  | 17.4.2 | 18.0.7 |


## [v18.0.7](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1807-2026-10-09)

##### Changed

- Treat undefined settings like `quiet: true` as null rather than falsey ([#1070](motdotla/dotenv#1070))
- CLI should honor `DOTENV_QUIET` setting in `.env` file ([#1071](motdotla/dotenv#1071))


## [v18.0.6](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1806-2026-10-06)

##### Changed

- Use smarter `parseBoolean` not Boolean() to fix override ([#1069](motdotla/dotenv#1069))


## [v18.0.5](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1805-2026-09-30)

##### Changed

- Fix missing typescript module declaration ([#1068](motdotla/dotenv#1068))
- Improve performance for large .env files ([#1066](motdotla/dotenv#1066))


## [v18.0.4](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1804-2026-09-25)

##### Changed

- `import dotenv/config` should default quiet: true ([#1063](motdotla/dotenv#1063))


## [v18.0.3](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1803-2026-09-22)

##### Changed

- Patch `DOTENV_QUIET` setting when inside .env file ([#1059](motdotla/dotenv#1059))


## [v18.0.2](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1802-2026-09-21)

##### Changed

- Patch additional edge cases for the fast parser ([#1056](motdotla/dotenv#1056))


## [v18.0.1](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1801-2026-09-18)

##### Changed

- Handle file urls in config logging ([#1054](motdotla/dotenv#1054))


## [v18.0.0](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1800-2026-09-17)

##### Added

- NEW: Dotenv now has a CLI. ([#1022](motdotla/dotenv#1022))

```sh
$ dotenv run -- node index.js
◇ injected env (2) from .env
Hello Dotenv
```

- NEW: Dotenv now has a fast parser thanks to [@homanp](https://github.com/homanp) of [superagent.sh](https://superagent.sh). Pass `config({ fast: true })`, flag `--fast`, or set `DOTENV_FAST=true` to opt-in to \~2x faster character-scanner parser. ([#1010](motdotla/dotenv#1010))

```sh
$ dotenv run --fast -- node index.js
◇ injected env (2) from .env
Hello Dotenv
```

[faster than Node native parseEnv!](https://dotenvx.com/blog/2026/09/28/dotenv-fast.html)

##### Changed

- Injecting message sent to stderr rather than stdout and tips removed ([#1037](motdotla/dotenv#1037))

##### Removed

- Remove tips ([#1031](motdotla/dotenv#1031))
- Remove skill files ([#1032](motdotla/dotenv#1032))
- Remove Spanish README ([#1034](motdotla/dotenv#1034))
- Remove .env.vault support ([#1033](motdotla/dotenv#1033))
- Remove preloading. Instead use cli `dotenv run -- your-command` ([#1035](motdotla/dotenv#1035))
renovate Bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Oct 10, 2026
| datasource | package | from   | to     |
| ---------- | ------- | ------ | ------ |
| npm        | dotenv  | 17.4.2 | 18.0.7 |


## [v18.0.7](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1807-2026-10-09)

##### Changed

- Treat undefined settings like `quiet: true` as null rather than falsey ([#1070](motdotla/dotenv#1070))
- CLI should honor `DOTENV_QUIET` setting in `.env` file ([#1071](motdotla/dotenv#1071))


## [v18.0.6](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1806-2026-10-06)

##### Changed

- Use smarter `parseBoolean` not Boolean() to fix override ([#1069](motdotla/dotenv#1069))


## [v18.0.5](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1805-2026-09-30)

##### Changed

- Fix missing typescript module declaration ([#1068](motdotla/dotenv#1068))
- Improve performance for large .env files ([#1066](motdotla/dotenv#1066))


## [v18.0.4](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1804-2026-09-25)

##### Changed

- `import dotenv/config` should default quiet: true ([#1063](motdotla/dotenv#1063))


## [v18.0.3](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1803-2026-09-22)

##### Changed

- Patch `DOTENV_QUIET` setting when inside .env file ([#1059](motdotla/dotenv#1059))


## [v18.0.2](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1802-2026-09-21)

##### Changed

- Patch additional edge cases for the fast parser ([#1056](motdotla/dotenv#1056))


## [v18.0.1](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1801-2026-09-18)

##### Changed

- Handle file urls in config logging ([#1054](motdotla/dotenv#1054))


## [v18.0.0](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1800-2026-09-17)

##### Added

- NEW: Dotenv now has a CLI. ([#1022](motdotla/dotenv#1022))

```sh
$ dotenv run -- node index.js
◇ injected env (2) from .env
Hello Dotenv
```

- NEW: Dotenv now has a fast parser thanks to [@homanp](https://github.com/homanp) of [superagent.sh](https://superagent.sh). Pass `config({ fast: true })`, flag `--fast`, or set `DOTENV_FAST=true` to opt-in to \~2x faster character-scanner parser. ([#1010](motdotla/dotenv#1010))

```sh
$ dotenv run --fast -- node index.js
◇ injected env (2) from .env
Hello Dotenv
```

[faster than Node native parseEnv!](https://dotenvx.com/blog/2026/09/28/dotenv-fast.html)

##### Changed

- Injecting message sent to stderr rather than stdout and tips removed ([#1037](motdotla/dotenv#1037))

##### Removed

- Remove tips ([#1031](motdotla/dotenv#1031))
- Remove skill files ([#1032](motdotla/dotenv#1032))
- Remove Spanish README ([#1034](motdotla/dotenv#1034))
- Remove .env.vault support ([#1033](motdotla/dotenv#1033))
- Remove preloading. Instead use cli `dotenv run -- your-command` ([#1035](motdotla/dotenv#1035))
markharding pushed a commit to futo-org/Harbor that referenced this pull request Oct 23, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [dotenv](https://github.com/motdotla/dotenv) | [`^17.4.2` → `^18.0.0`](https://renovatebot.com/diffs/npm/dotenv/17.4.2/18.0.8) | ![age](https://developer.mend.io/api/mc/badges/age/npm/dotenv/18.0.8?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/dotenv/17.4.2/18.0.8?slim=true) |

---

> ⚠️ **Warning**
>
> Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/99) for more information.

---

### Release Notes

<details>
<summary>motdotla/dotenv (dotenv)</summary>

### [`v18.0.8`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1808-2026-10-14)

[Compare Source](motdotla/dotenv@v18.0.7...v18.0.8)

##### Changed

- Fast parser should strip appended extra quotes ([#&#8203;1073](motdotla/dotenv#1073))
- Type detail improvement ([#&#8203;1074](motdotla/dotenv#1074))

### [`v18.0.7`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1807-2026-10-09)

[Compare Source](motdotla/dotenv@v18.0.6...v18.0.7)

##### Changed

- Treat undefined settings like `quiet: true` as null rather than falsey ([#&#8203;1070](motdotla/dotenv#1070))
- CLI should honor `DOTENV_QUIET` setting in `.env` file ([#&#8203;1071](motdotla/dotenv#1071))

### [`v18.0.6`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1806-2026-10-06)

[Compare Source](motdotla/dotenv@v18.0.5...v18.0.6)

##### Changed

- Use smarter `parseBoolean` not Boolean() to fix override ([#&#8203;1069](motdotla/dotenv#1069))

### [`v18.0.5`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1805-2026-09-30)

[Compare Source](motdotla/dotenv@v18.0.4...v18.0.5)

##### Changed

- Fix missing typescript module declaration ([#&#8203;1068](motdotla/dotenv#1068))
- Improve performance for large .env files ([#&#8203;1066](motdotla/dotenv#1066))

### [`v18.0.4`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1804-2026-09-25)

[Compare Source](motdotla/dotenv@v18.0.3...v18.0.4)

##### Changed

- `import dotenv/config` should default quiet: true ([#&#8203;1063](motdotla/dotenv#1063))

### [`v18.0.3`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1803-2026-09-22)

[Compare Source](motdotla/dotenv@v18.0.2...v18.0.3)

##### Changed

- Patch `DOTENV_QUIET` setting when inside .env file ([#&#8203;1059](motdotla/dotenv#1059))

### [`v18.0.2`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1802-2026-09-21)

[Compare Source](motdotla/dotenv@v18.0.1...v18.0.2)

##### Changed

- Patch additional edge cases for the fast parser ([#&#8203;1056](motdotla/dotenv#1056))

### [`v18.0.1`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1801-2026-09-18)

[Compare Source](motdotla/dotenv@v18.0.0...v18.0.1)

##### Changed

- Handle file urls in config logging ([#&#8203;1054](motdotla/dotenv#1054))

### [`v18.0.0`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1800-2026-09-17)

[Compare Source](motdotla/dotenv@v17.4.2...v18.0.0)

##### Added

- NEW: Dotenv now has a CLI. ([#&#8203;1022](motdotla/dotenv#1022))

```sh
$ dotenv run -- node index.js
◇ injected env (2) from .env
Hello Dotenv
```

- NEW: Dotenv now has a fast parser thanks to [@&#8203;homanp](https://github.com/homanp) of [superagent.sh](https://superagent.sh). Pass `config({ fast: true })`, flag `--fast`, or set `DOTENV_FAST=true` to opt-in to \~2x faster character-scanner parser. ([#&#8203;1010](motdotla/dotenv#1010))

```sh
$ dotenv run --fast -- node index.js
◇ injected env (2) from .env
Hello Dotenv
```

[faster than Node native parseEnv!](https://dotenvx.com/blog/2026/09/28/dotenv-fast.html)

##### Changed

- Injecting message sent to stderr rather than stdout and tips removed ([#&#8203;1037](motdotla/dotenv#1037))

##### Removed

- Remove tips ([#&#8203;1031](motdotla/dotenv#1031))
- Remove skill files ([#&#8203;1032](motdotla/dotenv#1032))
- Remove Spanish README ([#&#8203;1034](motdotla/dotenv#1034))
- Remove .env.vault support ([#&#8203;1033](motdotla/dotenv#1033))
- Remove preloading. Instead use cli `dotenv run -- your-command` ([#&#8203;1035](motdotla/dotenv#1035))

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - "before 9am on tuesday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xMzMuMCIsInVwZGF0ZWRJblZlciI6IjQ0LjE3NS4xIiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJyZW5vdmF0ZSJdfQ==-->

Reviewed-on: https://code.futo.org/harbor/harbor/pulls/1849
markharding pushed a commit to futo-org/Harbor that referenced this pull request Oct 29, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [dotenv](https://github.com/motdotla/dotenv) | [`^17.4.2` → `^18.0.0`](https://renovatebot.com/diffs/npm/dotenv/17.4.2/18.0.8) | ![age](https://developer.mend.io/api/mc/badges/age/npm/dotenv/18.0.8?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/dotenv/17.4.2/18.0.8?slim=true) |

---

> ⚠️ **Warning**
>
> Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/99) for more information.

---

### Release Notes

<details>
<summary>motdotla/dotenv (dotenv)</summary>

### [`v18.0.8`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1808-2026-10-14)

[Compare Source](motdotla/dotenv@v18.0.7...v18.0.8)

##### Changed

- Fast parser should strip appended extra quotes ([#&#8203;1073](motdotla/dotenv#1073))
- Type detail improvement ([#&#8203;1074](motdotla/dotenv#1074))

### [`v18.0.7`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1807-2026-10-09)

[Compare Source](motdotla/dotenv@v18.0.6...v18.0.7)

##### Changed

- Treat undefined settings like `quiet: true` as null rather than falsey ([#&#8203;1070](motdotla/dotenv#1070))
- CLI should honor `DOTENV_QUIET` setting in `.env` file ([#&#8203;1071](motdotla/dotenv#1071))

### [`v18.0.6`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1806-2026-10-06)

[Compare Source](motdotla/dotenv@v18.0.5...v18.0.6)

##### Changed

- Use smarter `parseBoolean` not Boolean() to fix override ([#&#8203;1069](motdotla/dotenv#1069))

### [`v18.0.5`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1805-2026-09-30)

[Compare Source](motdotla/dotenv@v18.0.4...v18.0.5)

##### Changed

- Fix missing typescript module declaration ([#&#8203;1068](motdotla/dotenv#1068))
- Improve performance for large .env files ([#&#8203;1066](motdotla/dotenv#1066))

### [`v18.0.4`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1804-2026-09-25)

[Compare Source](motdotla/dotenv@v18.0.3...v18.0.4)

##### Changed

- `import dotenv/config` should default quiet: true ([#&#8203;1063](motdotla/dotenv#1063))

### [`v18.0.3`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1803-2026-09-22)

[Compare Source](motdotla/dotenv@v18.0.2...v18.0.3)

##### Changed

- Patch `DOTENV_QUIET` setting when inside .env file ([#&#8203;1059](motdotla/dotenv#1059))

### [`v18.0.2`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1802-2026-09-21)

[Compare Source](motdotla/dotenv@v18.0.1...v18.0.2)

##### Changed

- Patch additional edge cases for the fast parser ([#&#8203;1056](motdotla/dotenv#1056))

### [`v18.0.1`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1801-2026-09-18)

[Compare Source](motdotla/dotenv@v18.0.0...v18.0.1)

##### Changed

- Handle file urls in config logging ([#&#8203;1054](motdotla/dotenv#1054))

### [`v18.0.0`](https://github.com/motdotla/dotenv/blob/HEAD/CHANGELOG.md#1800-2026-09-17)

[Compare Source](motdotla/dotenv@v17.4.2...v18.0.0)

##### Added

- NEW: Dotenv now has a CLI. ([#&#8203;1022](motdotla/dotenv#1022))

```sh
$ dotenv run -- node index.js
◇ injected env (2) from .env
Hello Dotenv
```

- NEW: Dotenv now has a fast parser thanks to [@&#8203;homanp](https://github.com/homanp) of [superagent.sh](https://superagent.sh). Pass `config({ fast: true })`, flag `--fast`, or set `DOTENV_FAST=true` to opt-in to \~2x faster character-scanner parser. ([#&#8203;1010](motdotla/dotenv#1010))

```sh
$ dotenv run --fast -- node index.js
◇ injected env (2) from .env
Hello Dotenv
```

[faster than Node native parseEnv!](https://dotenvx.com/blog/2026/09/28/dotenv-fast.html)

##### Changed

- Injecting message sent to stderr rather than stdout and tips removed ([#&#8203;1037](motdotla/dotenv#1037))

##### Removed

- Remove tips ([#&#8203;1031](motdotla/dotenv#1031))
- Remove skill files ([#&#8203;1032](motdotla/dotenv#1032))
- Remove Spanish README ([#&#8203;1034](motdotla/dotenv#1034))
- Remove .env.vault support ([#&#8203;1033](motdotla/dotenv#1033))
- Remove preloading. Instead use cli `dotenv run -- your-command` ([#&#8203;1035](motdotla/dotenv#1035))

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - "before 9am on tuesday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xMzMuMCIsInVwZGF0ZWRJblZlciI6IjQ0LjE3NS4xIiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJyZW5vdmF0ZSJdfQ==-->

Reviewed-on: https://code.futo.org/harbor/harbor/pulls/1849
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants