Socket
Socket
Sign inDemoInstall

stream-to-promise

Package Overview
Dependencies
3
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.0.2

16

index.js

@@ -9,9 +9,15 @@ 'use strict';

var promise = toArray(stream);
// Ensure stream is in flowing mode
stream.resume();
return promise
.map(function (part) {
return (part instanceof Buffer) ? part : new Buffer(part);
})
.then(Buffer.concat);
.then(function (parts) {
var buffers = [];
for (var i = 0, l = parts.length; i < l ; ++i) {
var part = parts[i];
buffers.push((part instanceof Buffer) ? part : new Buffer(part));
}
return Buffer.concat(buffers);
});
};

@@ -29,3 +35,3 @@

if (stream.readable) {
promise = internals.readable(stream);
promise = internals.readable(stream);
}

@@ -32,0 +38,0 @@ else if (stream.writable) {

{
"name": "stream-to-promise",
"version": "1.0.1",
"version": "1.0.2",
"description": "Convert readable streams to promises",

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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc