progress-stream
progress-stream copied to clipboard
It's possible for this package to cause a process.exit(0)
I haven't dug deeply into the specifics of this issue since I'm replacing the library, and I'm pretty confident this project is no longer maintained, but I want to leave some information here.
Effectively in node 16 I have:
const { pipeline } = require('stream/promises');
await pipeline(
procuder,
async function*{},
progressStream,
otherStuff
)
The stream itself gets processed and upon completion results in the equivalent of process.exit(0), it will not continue even wrapped in try {} finally {} and will exit with status 0. The only way to capture the process before exiting seem to be by listening to beforeExit or exit on process.
If I swap the order so the progress stream is before the async generator, execution completes normally:
const { pipeline } = require('stream/promises');
await pipeline(
procuder,
progressStream,
async function*{},
otherStuff
)
I suspect it's related to this:
- https://github.com/nodejs/node/issues/34219
- https://github.com/nodejs/node/issues/33792