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 - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

test/enc.js

9

index.js
var Promise = require('promise-polyfill')
module.exports = function (stream, cb) {
module.exports = function (stream, enc, cb) {
if (typeof enc === 'function') {
cb = enc
enc = null
}
cb = cb || function () {}
var str = ''

@@ -9,3 +14,3 @@

stream.on('data', function (data) {
str += data.toString()
str += (typeof enc === 'string') ? data.toString(enc) : data.toString()
})

@@ -12,0 +17,0 @@ stream.on('end', function () {

{
"name": "stream-to-string",
"version": "1.0.1",
"version": "1.1.0",
"description": "Pipe a stream into a string, collect value with callback or promise",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -6,3 +6,2 @@ # stream-to-string

[![Coverage Status](https://coveralls.io/repos/jasonpincin/stream-to-string/badge.png?branch=master)](https://coveralls.io/r/jasonpincin/stream-to-string?branch=master)
[![Davis Dependency Status](https://david-dm.org/jasonpincin/stream-to-string.png)](https://david-dm.org/jasonpincin/stream-to-string)

@@ -38,5 +37,5 @@ Pipe a stream into a string, collect value with callback or promise

### toString(stream [, cb])
### toString(stream[, enc][, cb])
Collects stream data into a string. Executes optional callback with `err, string`. Returns a promise.
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.

@@ -43,0 +42,0 @@ ## testing

Sorry, the diff of this file is not supported yet

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