Expose web stream read errors as node errors events
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.
@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.
Hi, are there plans on reviewing and possibly merging this at some point?
Bump
Any update on this?