In those rare cases that your method returns promise with a stream (which it really shouldn't), this little utility will convert it into a regular stream, the way it should be.
✨ Now with full support for TypeScript!
🔍 Found an issue? Please report it in the issue tracker so we can take care of it!
const fs = const streamNow = { await ; return ;} const stream = streamNow; // this will only start emitting when the promise is resolvedstream
API
streamNow.readable(promise, opts?)
Create a new readable stream out of the promised readable stream.
You must pass in { objectMode: true }
if your promised stream works with
objects instead of string data. There is no simple way to circumvent this
limitation.
streamNow.writable(promise, opts?)
Create a new writable stream out of the promised writable stream.
You must pass in { objectMode: true }
if your promised stream works with
objects instead of string data. There is no simple way to circumvent this
limitation.
License
The MIT license