Socket
Socket
Sign inDemoInstall

stream-to-buffer

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-to-buffer


Version published
Maintainers
1
Install size
3.65 kB
Created

Package description

What is stream-to-buffer?

The stream-to-buffer npm package is a utility that allows you to convert a readable stream into a buffer. This can be particularly useful when you need to handle data streams in a more manageable format, such as when dealing with file uploads, network responses, or any other form of streaming data.

What are stream-to-buffer's main functionalities?

Convert Stream to Buffer

This feature allows you to convert a readable stream into a buffer. In this example, a file stream is converted into a buffer and then logged to the console.

const streamToBuffer = require('stream-to-buffer');
const fs = require('fs');

const readableStream = fs.createReadStream('example.txt');

streamToBuffer(readableStream, (err, buffer) => {
  if (err) throw err;
  console.log(buffer.toString());
});

Other packages similar to stream-to-buffer

Readme

Source

Stream to Buffer

Concatenate a readable stream's data into a single buffer

API

var streamToBuffer = require('stream-to-buffer')

var stream = // Some readable stream

streamToBuffer(stream, function (err, buffer) {
  
})

License

The MIT License (MIT)

Copyright (c) 2013 Jonathan Ong me@jongleberry.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

FAQs

Last updated on 05 Jun 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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