Skip to content

Commit

Permalink
doc: update examples (nodejs#6367)
Browse files Browse the repository at this point in the history
Co-authored-by: Claudio W <[email protected]>
  • Loading branch information
GeoffreyBooth and ovflowd authored Feb 29, 2024
1 parent accacc1 commit 19cd9f9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pages/en/new-design/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ layout: home.hbs
});

test('that throws as 1 is not equal 2', () => {
// throws an exception because 1!=2
// throws an exception because 1 != 2
assert.strictEqual(1, 2);
});
```
Expand Down Expand Up @@ -99,13 +99,13 @@ layout: home.hbs
```

```js displayName="Work with Threads"
import { Worker, isMainThread } from 'node:worker_threads';
import { workerData, parentPort } from 'node:worker_threads';
import { Worker, isMainThread,
workerData, parentPort } from 'node:worker_threads';

if (isMainThread) {
const data = 'some data';
const worker = new Worker(import.meta.filename, { workerData: data });
worker.on('message', m => console.log('Reply from Thread:', m));
worker.on('message', msg => console.log('Reply from Thread:', msg));
} else {
const source = workerData;
parentPort.postMessage(btoa(source.toUpperCase()));
Expand Down

0 comments on commit 19cd9f9

Please sign in to comment.