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
Use new SyncChildProcess() to start running a subprocess. This supports the
same API as child_process.spawn() other than a few options. You can send
input to the process using process.stdin, and receive events from it
(stdout, stderr, or exit) using process.next(). This implements the
iterator protocol, but not the iterable protocol because it's intrinsically
stateful.
See the sync-message-port documentation for an explanation of why running
code synchronously can be valuable even in an asynchronous ecosystem like
Node.js
Why not child_process.spawnSync()?
Although Node's built-in child_process.spawnSync() function does run
synchronously, it's not interactive. It only returns once the process has run to
completion and exited, which means it's not suitable for any long-lived
subprocess that interleaves sending and receiving data, such as when using the
embedded Sass protocol.
Disclaimer: this is not an official Google product.
About
An interactive, synchronous API for subprocesses in Node.js