Skip to main content
setEnvironmentData - node__worker_threads.d.ts - Node documentation
function setEnvironmentData

Usage in Deno

```typescript import { setEnvironmentData } from "node:node__worker_threads.d.ts"; ```
setEnvironmentData(): void
The `worker.setEnvironmentData()` API sets the content of `worker.getEnvironmentData()` in the current thread and all new `Worker` instances spawned from the current context.

Parameters

Any arbitrary, cloneable JavaScript value that can be used as a {Map} key.
Any arbitrary, cloneable JavaScript value that will be cloned and passed automatically to all new `Worker` instances. If `value` is passed as `undefined`, any previously set value for the `key` will be deleted.

Return Type

void