You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Being able to spawn a worker thread instead of a child process using a simple boolean option would be nice.
awaitexeca(...,{thread: true});
Unlike Worker in browsers, Node.js worker_threads includes many similar features as child processes: environment variables, stdin/stdout/stderr, argv.
Also, most of Execa's logic is actually userland, i.e. implemented by us and not borrowed from child_process.spawn(). For example, most things input/output-related (including subprocess piping), the verbose mode, etc. It would be nice to be able to re-use all of those Execa features but with a worker thread instead. I believe 90-95% of features can be re-used.
This option would imply the node: true option, since only Node.js files can be launched as threads.
Instead of returning a .subprocess property (#413), this would return a .worker property, with the Worker instead. We would try to make the properties/methods as close to .subprocess as possible, for parity.
That's a bigger feature, but this might be quite useful. What are your thoughts on this @sindresorhus?
The text was updated successfully, but these errors were encountered:
Being able to spawn a worker thread instead of a child process using a simple boolean option would be nice.
Unlike
Worker
in browsers, Node.jsworker_threads
includes many similar features as child processes: environment variables,stdin
/stdout
/stderr
,argv
.Also, most of Execa's logic is actually userland, i.e. implemented by us and not borrowed from
child_process.spawn()
. For example, most things input/output-related (including subprocess piping), the verbose mode, etc. It would be nice to be able to re-use all of those Execa features but with a worker thread instead. I believe 90-95% of features can be re-used.This option would imply the
node: true
option, since only Node.js files can be launched as threads.Instead of returning a
.subprocess
property (#413), this would return a.worker
property, with theWorker
instead. We would try to make the properties/methods as close to.subprocess
as possible, for parity.That's a bigger feature, but this might be quite useful. What are your thoughts on this @sindresorhus?
The text was updated successfully, but these errors were encountered: