nightskyjeff – 01-27 Jan 10

const feed = Readable.from([ 'abc', 'def', 'ghi', 'jkl' ]).pipe(process.stdout);
console.log("waiting for feed to finish");
await finished(feed);
console.log("feed finished");
const feed = Readable.from([ 'abc', 'def', 'ghi', 'jkl' ]).pipe(process.stdout);
console.log("waiting for feed to finish");
await finished(feed);
console.log("feed finished");
^ this simple Readable.from().pipe() never finishes. what am I missing? I feel like it's obvious and I'm blind.
N
NightSkyJeff100d ago
If I use for await (const chunk of feed) { ... } instead of piping to stdout, the feed does indeed end as expected. But I can't get it to end with just the pipe() UGH
The process.stderr and process.stdout Writable streams are never closed until the Node.js process exits, regardless of the specified options.
I think that's the problem 🙂
UU
Unknown User98d ago