Skip to content

Add more details to process.env and importable env #23304

@vicb

Description

@vicb

Proposed changes

https://developers.cloudflare.com

Subject Matter

process.env for Workers in Node compat mode

Content Location

https://developers.cloudflare.com

Additional information

@mikenomitch added docs for the auto-population of process.env in #20642. There was a prior #19187 containing more details that is still opened.

The first thing we need to do is add missing details from #19187 in the content here - not that #19817 is not fully up to date as it was not updated after the importable env was added to runtime.

The 2 things that I think are different now:

  • what get serialized and how - Change process.env implementation to be based on importable env. workerd#3778 is a good starting point but I think the behavior was further updated, need to check with the runtime time
  • IIUC using the disallow_importable_env disable auto-population of process.env - I think this should be documented on both disallow_importable_env and nodejs_compat_populate_process_env flags. Probably also at src/content/docs/workers/runtime-apis/nodejs/process.mdx

Metadata

Metadata

Labels

content:newRequest for new/missing contentdocumentationDocumentation edits

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions