Skip to content

Commit 0149b6b

Browse files
authored
Update README.md
1 parent b1b8ec8 commit 0149b6b

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

README.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,9 @@ Depending on the environment, it uses [Worker Threads](https://nodejs.org/api/wo
2424
npm install multithreading
2525
```
2626

27-
#### Node.js
28-
To use the `multithreading` package with Node.js, and to keep the bundle size as small as possible, it is necessary to install the [web-worker](https://www.npmjs.com/package/web-worker) package separately because Node.js does not support web workers by default.
29-
30-
```bash
31-
npm install web-worker
32-
```
33-
3427
## Usage
3528

36-
#### Minimal example
29+
#### Basic example
3730

3831
```js
3932
import { threaded } from "multithreading";
@@ -112,7 +105,7 @@ await Promise.all([
112105

113106
console.log(user.balance); // 15
114107
```
115-
In this example, the `addBalance` function integrates the external `add` function into a multithreaded environment. The `yield` statement is used to declare external dependencies, ensuring that the required functions and data are available to the threaded function.
108+
In this example, the `add` function is used within the multithreaded `addBalance` function. The `yield` statement is used to declare external dependencies, ensuring that the required functions and data are available to the threaded function.
116109

117110
As with previous examples, the shared state is managed using `$claim` and `$unclaim` to guarantee proper synchronization and prevent data conflicts.
118111

0 commit comments

Comments
 (0)