diff --git a/docs/usage.md b/docs/usage.md index 2f83ac5b..0d0dc16f 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -175,7 +175,8 @@ You can also pass other `WorkerOptions` in this object. `createWorker` uses dynamic imports to only import the needed implementation, so you can import the needed functions directly to reduce the bundle size. ```js -import { createWorker, spawn, Thread } from "threads" +import { createWorker } from "threads/createWorker" +import { spawn, Thread } from "threads" async function run() { const worker = await createWorker("./worker.js", {backend: "node"}) diff --git a/src/index.ts b/src/index.ts index 3239e2ec..8daf5286 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,4 +3,3 @@ export * from "./master/index" export { expose } from "./worker/index" export { DefaultSerializer, JsonSerializable, Serializer, SerializerImplementation } from "./serializers" export { Transfer, TransferDescriptor } from "./transferable" -export { createWorker } from "./createWorker"