Skip to content

worker: update code examples for node:worker_threads module #58264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fisker
Copy link
Contributor

@fisker fisker commented May 10, 2025

  • Missed one import.
  • Use .once for one time events.
  • Use node:assert/strict instead of node:assert.

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. worker Issues and PRs related to Worker support. labels May 10, 2025
@@ -1384,7 +1385,7 @@ and what kind of JavaScript values can be successfully transported through
the thread barrier.

```mjs
import assert from 'node:assert';
import assert from 'node:assert/strict';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rest of the changes here are ok but this one is generally unnecessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. worker Issues and PRs related to Worker support.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants