Better streams for Node.js.
npm install ia-streamia-streamStreams in Node.js don't have the ability to seek; and you can only read the data in them once. This is majorly inconvient for operations like random access to a file.
The obvious solution is to just use fs methods directly, but this isn't ideal either — what if you need an abstraction where the data behind the stream can come from a place other than a file?
This package provides streams that are modeled after Streams in .NET, allowing random access / seeking, reading data more than once, and providing a Promise-based API.
doctsFileStream<> FileStream <> FileHandle FileStreamOptions Promise<boolean> <> number Promise<Buffer> <> number undefined | true | false Promise<Buffer> <> seek and read. number number undefined | true | false Promise<number> <> Buffer Promise<boolean> <> number Promise<void> <> Stream will no longer be usable. Promise<Stream> <> Stream that operates on the same source material as this stream. Promise<Stream> <> Stream that operates on the same source material as this stream. number number MemoryStream<> MemoryStream <> MemoryStreamOptionsWithData | MemoryStreamOptionsWithLength Promise<boolean> <> number Promise<Buffer> <> number undefined | true | false Promise<Buffer> <> seek and read. number number undefined | true | false Promise<number> <> Buffer Promise<boolean> <> number Promise<void> <> Stream will no longer be usable. Promise<Stream> <> Stream that operates on the same source material as this stream. Promise<Stream> <> Stream that operates on the same source material as this stream. number number Stream<> Promise<boolean> <> number The position to set the cursor to. Promise<Buffer> <> number The maximum number of bytes to return. undefined | true | false If true, then this method will block until length bytes are availablePromise<Buffer> <> seek and read. number The starting position to read from. number The maximum number of bytes to return. undefined | true | false If true, then this method will block until length bytes are availablePromise<number> <> Buffer A Buffer containing the data to write. Promise<boolean> <> number The new length of this stream. Promise<void> <> Stream will no longer be usable. Promise<Stream> <> Stream that operates on the same source material as this stream. Promise<Stream> <> number number Duplex <> number number boolean true if this stream can be written to. boolean true if this stream can be read from. boolean true if this stream can be seeked within. boolean true if this stream is currently open.
© 2019 Ibiyemi Abiodun (laptou) \