JSPM

stream-to-string

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 96430
  • Score
    100M100P100Q150172F
  • License MIT

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

Package Exports

  • stream-to-string

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (stream-to-string) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

stream-to-string

NPM version Build Status Coverage Status Davis Dependency 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 [, cb])

Collects stream data into a string. Executes optional callback with err, string. Returns a promise.

testing

npm test [--dot | --spec] [--coverage]

Alternatively, only run test files matching a certain pattern by prefixing the command with grep=pattern. Example: grep=init npm test

Open an html coverage report after running tests with npm run view-cover or npm run vc