Skip to content

Instantly share code, notes, and snippets.

@watson
Last active November 2, 2022 10:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save watson/da8459485f6daaa4268a9369a9362439 to your computer and use it in GitHub Desktop.
Save watson/da8459485f6daaa4268a9369a9362439 to your computer and use it in GitHub Desktop.
Is this expected behaviour of stream.finished?
const { PassThrough, finished } = require('stream');
console.log('Waiting for stream to finish...');
finished(new PassThrough(), (err) => {
// This callback is never called and the process exits with exit code 0 right away
console.log('Stream has finished!', { err });
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment