readable-stream - A Streams3, a user-land copy of the stream library from Node.js
This package is a mirror of the Streams2 and Streams3 implementations in Node-core.
Full documentation may be found on the Node.js website.
If you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use readable-stream only and avoid the "stream" module in Node-core, for background see this blogpost.
$ sbt clean publish-local
Before running the tests the first time, you must ensure the npm packages are installed:
$ npm install
Then you can run the tests:
$ sbt test
import io.scalajs.nodejs.buffer.Buffer
import io.scalajs.nodejs.process
import io.scalajs.npm.readablestream.Readable
val bulk = new Readable()
bulk._read = () => {}
('A' to 'F') foreach { ch =>
bulk.push(Buffer.from(String.valueOf(ch)))
}
bulk.push(null)
bulk.pipe(process.stdout)
ABCDEF
To add the ReadableStream
binding to your project, add the following to your build.sbt:
libraryDependencies += "io.scalajs.npm" %%% "readable-stream" % "0.5.0"
Optionally, you may add the Sonatype Repository resolver:
resolvers += Resolver.sonatypeRepo("releases")