NightSkyJeff
NightSkyJeffβ€’7mo ago

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.
2 Replies
NightSkyJeff
NightSkyJeffβ€’7mo 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 πŸ™‚
reactibot
reactibotβ€’7mo ago
This thread hasn’t had any activity in 36 hours, so it’s now locked. Threads are closed automatically after 36 hours. If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/565213527673929729/1194452515857629184