Skip to content

fix(ext/node): util.parseEnv and process.loadEnvFile compatibility#32183

Merged
Tango992 merged 23 commits intodenoland:mainfrom
Tango992:fix-node-util-parseenv
Feb 20, 2026
Merged

fix(ext/node): util.parseEnv and process.loadEnvFile compatibility#32183
Tango992 merged 23 commits intodenoland:mainfrom
Tango992:fix-node-util-parseenv

Conversation

@Tango992
Copy link
Copy Markdown
Contributor

@Tango992 Tango992 commented Feb 15, 2026

Continues the work from #31856. Closes #30952.

Ported the node's env parser instead of using dotenvy, since there are some differences that makes the node compat test won't pass if dotenvy was used.

Allows https://github.com/nodejs/node/blob/v24.12.0/test/parallel/test-util-parse-env.js to pass

@Tango992 Tango992 marked this pull request as draft February 16, 2026 08:53
@Tango992 Tango992 marked this pull request as ready for review February 17, 2026 10:38
@Tango992 Tango992 changed the title fix(ext/node): implement util.parseEnv fix(ext/node): util.parseEnv and process.loadEnvFile compatibility Feb 17, 2026
Copy link
Copy Markdown
Contributor

@Hajime-san Hajime-san left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks!

Comment on lines +132 to +133
parse_env_content_hook(&contents, |key, value| {
// Follows Node.js behavior where null bytes are stripped from env keys and values
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bartlomieju bartlomieju requested a review from dsherret February 19, 2026 08:24
@bartlomieju
Copy link
Copy Markdown
Member

LGTM, I'll let David take another look before approving

Copy link
Copy Markdown
Contributor

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. LGTM

@Tango992 Tango992 merged commit 498d6ef into denoland:main Feb 20, 2026
110 checks passed
@Tango992 Tango992 deleted the fix-node-util-parseenv branch February 20, 2026 15:44
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.

parseEnv from node:util not supported in Deno

5 participants