Closed AleFons closed 4 years ago
Sure! There's no built-in FileSource
though, but you can take a look at the implementation of FileSink
for inspiration, or with recent NodeJS just do something along the lines of:
try {
for (const buffer of myFile) {
await myStream.write(buffer);
}
await mystream.end();
} catch (err) {
myStream.abort(err);
}
Note that this lib is mostly meant for handling object streams, so it will e.g. not try to concatenate buffers.
Is it possible to read from a file? I can render the file as a text or binary format, if necessary.