Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno/cli/tsc/dts/lib.deno.unstable.d.ts>WorkerOptions

A modern runtime for JavaScript and TypeScript.
Go to Latest
interface WorkerOptions
import { type WorkerOptions } from "https://deno.land/x/deno@v1.36.0/cli/tsc/dts/lib.deno.unstable.d.ts";

UNSTABLE: New API, yet to be vetted.

Properties

optional
deno: { permissions?: Deno.PermissionOptions; }

UNSTABLE: New API, yet to be vetted.

Configure permissions options to change the level of access the worker will have. By default it will have no permissions. Note that the permissions of a worker can't be extended beyond its parent's permissions reach.

  • "inherit" will take the permissions of the thread the worker is created in.
  • "none" will use the default behavior and have no permission
  • A list of routes can be provided that are relative to the file the worker is created in to limit the access of the worker (read/write permissions only)

Example:

// mod.ts
const worker = new Worker(
  new URL("deno_worker.ts", import.meta.url).href, {
    type: "module",
    deno: {
      permissions: {
        read: true,
      },
    },
  }
);