stream-to-string

WebJar for stream-to-string

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

stream-to-string
Last Version

Last Version

1.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

stream-to-string
WebJar for stream-to-string
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/jasonpincin/stream-to-string

Download stream-to-string

How to add to project

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

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : promise-polyfill jar [1.1.6,2)

Project Modules

There are no modules declared in this project.

stream-to-string

NPM version Build Status Coverage Status

Pipe a stream into a string, collect value with callback or promise

example

var toString = require('..'),
    through2 = require('through2'),
    stream   = through2()

toString(stream, function (err, msg) {
    console.log(msg)
})

# or with promises
toString(stream).then(function (msg) {
    console.log(msg)
})

stream.write('this is a')
stream.write(' test')
stream.end()

api

var toString = require('stream-to-string')

toString(stream[, enc][, cb])

Collects stream data into a string. Accepts an optional encoding argument used when converting the stream. Executes optional callback with err, string. Returns a promise.

testing

npm test [--dot | --spec] [--coverage | --grep=pattern]

Specifying --dot or --spec will change the output from the default TAP style. Specifying --coverage will print a text coverage summary to the terminal after tests have ran, while --pattern will only run the test files that match the given pattern.

Open an html coverage report with npm run view-cover.

Versions

Version
1.2.0