Last active
November 2, 2022 10:06
-
-
Save watson/da8459485f6daaa4268a9369a9362439 to your computer and use it in GitHub Desktop.
Is this expected behaviour of stream.finished?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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