Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

stream-to-string

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-to-string

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

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
27K
decreased by-60.44%
Maintainers
1
Weekly downloads
 
Created
Source

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 | --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.

Keywords

FAQs

Package last updated on 28 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc