Skip to content

Commit abe8915

Browse files
committed
minor fixes for process.env
1 parent ef39308 commit abe8915

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/content/changelog/workers/2025-03-11-process-env-support.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Access your Worker's environment variables from process.env
3-
description: With Node.js compatability on, process.env is automatically populated with environment variables and secrets
3+
description: With Node.js compatibility on, process.env is automatically populated with environment variables and secrets
44
products:
55
- workers
66
date: 2025-03-11T15:00:00Z
@@ -10,7 +10,7 @@ import { WranglerConfig } from "~/components";
1010

1111
You can now access [environment variables](/workers/configuration/environment-variables/) and
1212
[secrets](/workers/configuration/secrets/) on [`process.env`](/workers/runtime-apis/nodejs/process/#processenv)
13-
when using the [`nodejs_compat` compatability flag](/workers/configuration/compatibility-flags/#nodejs-compatibility-flag).
13+
when using the [`nodejs_compat` compatibility flag](/workers/configuration/compatibility-flags/#nodejs-compatibility-flag).
1414

1515
```js
1616
const apiClient = ApiClient.new({ apiKey: process.env.API_KEY });

src/content/compatibility-flags/nodejs-compat-populate-process-env.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: "Enable auto-populating `process.env`"
3-
sort_date: "2025-02-27"
3+
sort_date: "2025-04-01"
44
enable_date: "2025-04-01"
55
enable_flag: "nodejs_compat_populate_process_env"
66
disable_flag: "nodejs_compat_do_not_populate_process_env"
@@ -18,7 +18,7 @@ const LOG_LEVEL = process.env.LOG_LEVEL || "info";
1818
```
1919

2020
This makes accessing these values easier and conforms to common Node.js patterns, which can
21-
reduce toil and help with compatability for existing Node.js libraries.
21+
reduce toil and help with compatibility for existing Node.js libraries.
2222

2323
If users do not wish for these values to be accessible via `process.env`, they can use the
2424
`nodejs_compat_do_not_populate_process_env` flag. In this case, `process.env` will still be

src/content/docs/r2/data-catalog/config-examples/spark-scala.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ sbt clean assembly
126126

127127
After building, the output JAR should be located at `target/scala-2.12/R2DataCatalogDemo-assembly-1.0.jar`.
128128

129-
To run the application, you will use `spark-submit`. Below is an example shell script (`submit.sh`) that includes the necessary Java compatability flags for Spark on Java 17:
129+
To run the application, you will use `spark-submit`. Below is an example shell script (`submit.sh`) that includes the necessary Java compatibility flags for Spark on Java 17:
130130

131131
```
132132
# We need to set these "--add-opens" so that Spark can run on Java 17 (it needs access to

src/content/docs/workers/runtime-apis/nodejs/process.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ nextTick(() => {
2828

2929
In the Node.js implementation of `process.env`, the `env` object is a copy of the environment variables at the time the process was started. In the Workers implementation, there is no process-level environment, so by default `env` is an empty object. You can still set and get values from `env`, and those will be globally persistent for all Workers running in the same isolate and context (for example, the same Workers entry point).
3030

31-
When [Node.js compatability](/workers/runtime-apis/nodejs/) is turned on and the [`nodejs_compat_populate_process_env`](/workers/configuration/compatibility-flags/#enable-auto-populating-processenv) compatability flag is set, `process.env` will contain any [environment variables](/workers/configuration/environment-variables/),
31+
When [Node.js compatibility](/workers/runtime-apis/nodejs/) is turned on and the [`nodejs_compat_populate_process_env`](/workers/configuration/compatibility-flags/#enable-auto-populating-processenv) compatibility flag is set, `process.env` will contain any [environment variables](/workers/configuration/environment-variables/),
3232
[secrets](/workers/configuration/secrets/), or [version metadata](/workers/runtime-apis/bindings/version-metadata/) metadata that has been configured on your Worker.
3333

3434
### Relationship to per-request `env` argument in `fetch()` handlers

0 commit comments

Comments
 (0)