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

Expose web stream read errors as node errors events #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pimterry
Copy link

@pimterry pimterry commented Jul 6, 2018

Fixes #3.

This also bumps web-streams-polyfill to the latest release, since otherwise the outdated dependency for that causes issues (see creatorrr/web-streams-polyfill#14), so closes #2 and fixes #1.

Tested with:

const { ReadableStream, toWebReadableStream, toNodeReadable } = require(".");

let nodeReader = require('fs').createReadStream('/tmp/test.txt');
let webReader = toWebReadableStream(nodeReader);
let roundTrippedReader = toNodeReadable(webReader);

roundTrippedReader.pipe(process.stdout);
roundTrippedReader.on('error', (e) => console.log('Caught error', e.message));

If /tmp/test.txt exists, the contents should be printed. If not, an 'ENOENT' error should be caught and printed.

@pimterry
Copy link
Author

@gwicke any enthusiasm for merging this? It seems to work very reliably for me (I'm now using this fork directly in production) but I'd much rather have it merged so I can depend on this package directly.

@thgreasi
Copy link

Hi, are there plans on reviewing and possibly merging this at some point?

@thgreasi
Copy link

Bump

@thgreasi
Copy link

Any update on 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 this pull request may close these issues.

WHATWG stream errors should be emitted as Node errors dependency on outdated polyfill fork
2 participants