Class Wraker

Constructors

Methods

Constructors

  • Create a new Wraker instance

    Parameters

    • OptionalscriptURL: string | URL

      URL of the worker script

    • Optionaloptions: WorkerOptions

      Worker options

    Returns Wraker

    Wraker instance

    const instance = new Wraker(new URL("worker.js", import.meta.url), {
    type: "module",
    });

Methods

  • Initialize a Wraker instance from an existing Worker

    Parameters

    • worker: Worker

      Worker instance

    Returns Wraker

    Wraker instance

    const worker = new Worker("worker.js");
    const instance = Wraker.fromWorker(worker);