New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

stream-to-promise

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-to-promise - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

3

index.js

@@ -6,2 +6,5 @@ var toArray = require('stream-to-array');

return Promise.promisify(toArray)(stream)
.map(function (part) {
return (part instanceof Buffer) ? part : new Buffer(part);
})
.then(Buffer.concat)

@@ -8,0 +11,0 @@ .error(function (err) {

2

package.json
{
"name": "stream-to-promise",
"version": "0.0.3",
"version": "0.0.4",
"description": "Convert readable streams to promises",

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

@@ -44,2 +44,11 @@ 'use strict';

it('can handle streams of buffers and strings', function () {
stream.emit('data', new Buffer('foo'));
stream.emit('data', 'bar');
stream.emit('end');
return promise.then(function (buffer) {
expect(buffer.toString()).to.equal('foobar');
});
});
it('resolves immediately for ended streams', function () {

@@ -46,0 +55,0 @@ stream.readable = false;

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