Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

depending on definition of writable stream #7

Closed
ORESoftware opened this issue Jan 9, 2017 · 3 comments · Fixed by #20
Closed

depending on definition of writable stream #7

ORESoftware opened this issue Jan 9, 2017 · 3 comments · Fixed by #20

Comments

@ORESoftware
Copy link

there is a check for a writable stream

isStream.writable = function (stream) {
    return  stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
};

if you do this:

     const z = fs.createWriteStream(dest);
     z.write('summa');
     z.end();
     return z;

calling end() will set writable to false, but it's still a writable stream, it's just no longer writable.

do you think this is a bug or is this the desired behavior? I think it would be better to remove that check to see if writable !==false...

@ORESoftware
Copy link
Author

then again, if end is called, you may not be able to listen to events because all the events may have already fired, kind of a weird one.

@kevva
Copy link
Contributor

kevva commented Jul 5, 2017

This was added due to #1. And yeah, technically, it's not a writable stream anymore since you can't write to it.

@ehmicky
Copy link
Contributor

ehmicky commented Feb 18, 2024

I have opened #20 which fixes this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants