node-web-streams icon indicating copy to clipboard operation
node-web-streams copied to clipboard

Expose web stream read errors as node errors events

Open pimterry opened this issue 7 years ago • 4 comments

Fixes #3.

This also bumps web-streams-polyfill to the latest release, since otherwise the outdated dependency for that causes issues (see https://github.com/creatorrr/web-streams-polyfill/issues/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 avatar Jul 06 '18 13:07 pimterry

@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.

pimterry avatar Jul 23 '18 10:07 pimterry

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

thgreasi avatar Feb 28 '19 11:02 thgreasi

Bump

thgreasi avatar Jun 28 '19 09:06 thgreasi

Any update on this?

thgreasi avatar Feb 13 '20 12:02 thgreasi