Skip to content

Commit

Permalink
Don't export createWorker from index
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Mar 27, 2021
1 parent eee7976 commit d0d2089
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"})
Expand Down
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit d0d2089

Please sign in to comment.