end-stream

WebJar for end-stream

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

end-stream
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

end-stream
WebJar for end-stream
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/Raynos/end-stream

Download end-stream

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/end-stream/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>end-stream</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/end-stream/
implementation 'org.webjars.npm:end-stream:0.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/end-stream/
implementation ("org.webjars.npm:end-stream:0.1.0")
'org.webjars.npm:end-stream:jar:0.1.0'
<dependency org="org.webjars.npm" name="end-stream" rev="0.1.0">
  <artifact name="end-stream" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='end-stream', version='0.1.0')
)
libraryDependencies += "org.webjars.npm" % "end-stream" % "0.1.0"
[org.webjars.npm/end-stream "0.1.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : write-stream jar [0.4.3,0.5)

Project Modules

There are no modules declared in this project.

end-stream

A stream that ends after computation finishes

Example

When you end this writable stream it will only emit "finish" after it's finished asynchronously writing each chunk you've written to the stream

var stream = EndStream(function write(value, cb) {
    // do something async
    async(value, function (err) {
        // tell cb that your done writing it.
        // Optionally pass it an err as a shorthand for
        // stream.emit("error", err)
        cb(err)
    })
})

stream.write(foo)
stream.write(bar)

stream.end()
stream.on("finish", function () {
    // only called after both foo and bar have been
    // asynchronously written. e.g. persisted to db.
})

Installation

npm install end-stream

Contributors

  • Raynos

MIT Licenced

Versions

Version
0.1.0