From d0d208970c87c4ea859f2f95d37a7b4b60b517ed Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sat, 27 Mar 2021 09:57:39 -0500 Subject: [PATCH] Don't export createWorker from index --- docs/usage.md | 3 ++- src/index.ts | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) 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"