Socket
Socket
Sign inDemoInstall

stream-to-array

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-to-array - npm Package Compare versions

Comparing version 2.0.2 to 2.1.0

LICENSE

2

index.js

@@ -38,3 +38,3 @@

function onClose() {
resolve()
resolve(arr)
cleanup()

@@ -41,0 +41,0 @@ }

{
"name": "stream-to-array",
"description": "Concatenate a readable stream's data into a single array",
"version": "2.0.2",
"version": "2.1.0",
"author": {

@@ -18,4 +18,4 @@ "name": "Jonathan Ong",

"devDependencies": {
"mocha": "1",
"istanbul": "0"
"istanbul": "0",
"mocha": "^2.3.3"
},

@@ -22,0 +22,0 @@ "scripts": {

@@ -9,3 +9,2 @@ # Stream to Array

[![Downloads][downloads-image]][downloads-url]
[![Gittip][gittip-image]][gittip-url]

@@ -46,10 +45,9 @@ Concatenate a readable stream's data into a single array.

If `callback` is not defined, then it is assumed that it is being yielded within a generator.
If `callback` is not defined, then it returns a promise.
```js
function* () {
var stream = new Stream.Readable()
stream.toArray = toArray
var arr = yield stream.toArray()
}
toArray(stream)
.then(function (parts) {
})
```

@@ -60,5 +58,11 @@

```js
var stream = new Stream.Readable()
var arr = yield toArray(stream)
var buffer = Buffer.concat(arr)
toArray(stream)
.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)
})
```

@@ -80,3 +84,1 @@

[downloads-url]: https://npmjs.org/package/stream-to-array
[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square
[gittip-url]: https://www.gittip.com/jonathanong/
SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc