Socket
Socket
Sign inDemoInstall

stream-to-buffer

Package Overview
Dependencies
1
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.1 to 0.1.0

24

index.js

@@ -1,23 +0,1 @@

module.exports = function streamToBuffer(stream, callback) {
var done = false
var buffers = []
stream.on('data', function (data) {
buffers.push(data)
})
stream.on('end', function () {
if (done)
return
done = true
callback(null, Buffer.concat(buffers))
buffers = null
})
stream.on('error', function (err) {
done = true
buffers = null
callback(err)
})
}
module.exports = require('stream-to').buffer

5

package.json
{
"name": "stream-to-buffer",
"description": "Concatenate a readable stream's data into a single buffer",
"version": "0.0.1",
"version": "0.1.0",
"dependencies": {
"stream-to": "~0.2.0"
},
"author": {

@@ -6,0 +9,0 @@ "name": "Jonathan Ong",

# Stream to Buffer
Concatenate a readable stream's data into a single buffer
This repository is deprecated.
Please use [stream-to](https://github.com/jonathanong/stream-to) instead.
Concatenate a readable stream's data into a single `Buffer` instance.
## API

@@ -39,2 +42,2 @@

OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
THE SOFTWARE.
SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc