Socket
Socket
Sign inDemoInstall

stream-to-promise

Package Overview
Dependencies
5
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.1.1 to 2.2.0

6

index.js

@@ -5,2 +5,3 @@ 'use strict'

var Promise = require('any-promise')
var onEnd = require('end-of-stream')

@@ -32,4 +33,5 @@ module.exports = streamToPromise

return new Promise(function (resolve, reject) {
stream.once('finish', resolve)
stream.once('error', reject)
onEnd(stream, function (err) {
(err ? reject : resolve)(err)
})
})

@@ -36,0 +38,0 @@ }

{
"name": "stream-to-promise",
"version": "2.1.1",
"version": "2.2.0",
"description": "Convert streams (readable or writable) to promises",

@@ -25,2 +25,3 @@ "main": "index.js",

"any-promise": "~1.3.0",
"end-of-stream": "~1.1.0",
"stream-to-array": "~2.3.0"

@@ -35,3 +36,3 @@ },

"rimraf": "^2.4.4",
"standard": "^5.4.1"
"standard": "^7.1.2"
},

@@ -38,0 +39,0 @@ "files": [

@@ -33,3 +33,3 @@ stream-to-promise [![Build Status](https://travis-ci.org/bendrucker/stream-to-promise.svg)](https://travis-ci.org/bendrucker/stream-to-promise)

writableStream.write('data')
writeableStream.end() // promise is resolved here
writableStream.end() // promise is resolved here
```

@@ -36,0 +36,0 @@

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