Skip to content

Commit 3be9a05

Browse files
committed
Don't export createWorker from index
1 parent eee7976 commit 3be9a05

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

docs/usage.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ You can also pass other `WorkerOptions` in this object.
175175
`createWorker` uses dynamic imports to only import the needed implementation, so you can import the needed functions directly to reduce the bundle size.
176176

177177
```js
178-
import { createWorker, spawn, Thread } from "threads"
178+
import { createWorker } from "threads/createWorker"
179+
import { spawn, Thread } from "threads"
179180

180181
async function run() {
181182
const worker = await createWorker("./worker.js", {backend: "node"})

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ export * from "./master/index"
33
export { expose } from "./worker/index"
44
export { DefaultSerializer, JsonSerializable, Serializer, SerializerImplementation } from "./serializers"
55
export { Transfer, TransferDescriptor } from "./transferable"
6-
export { createWorker } from "./createWorker"

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
},
1414
"include": [
1515
"./src/index.ts",
16+
"./src/createWorker.ts",
1617
"./src/observable.ts",
1718
"./src/master/*",
1819
"./src/worker/*",

0 commit comments

Comments
 (0)