-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
Closed
Labels
workerIssues and PRs related to Worker support.Issues and PRs related to Worker support.
Description
- Version: v12.5.0
- Platform: Mac
- Subsystem: worker_threads
Steps to reproduce:
- Create two scripts, a.js:
const { Worker } = require('worker_threads');
const worker = new Worker('console.log(42)', { eval: true, data: {} });
and b.js:
const { isMainThread } = require('worker_threads');
console.log('b', isMainThread);
- Run
node --require b.js a.js
- Take a look on output:
b true
b false
42
I am wondering is it feature or bug that we inject --require
module to workers. If it is feature, should we mention it in workers doc and in --require
flag description?
In my use case - I use --require
to implement inspector
socket discovery in user land - I need --require
only for main thread. I can workaround it on my side but do we need some additional flag that will inject to workers instead of reusing existing flag.
bricss
Metadata
Metadata
Assignees
Labels
workerIssues and PRs related to Worker support.Issues and PRs related to Worker support.