Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chunked-buffer

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chunked-buffer - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

2

package.json
{
"name": "chunked-buffer",
"version": "0.0.2",
"version": "0.0.3",
"description": "Small function you can wrap fs.createReadStream with to get fixed size data chunks",

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

# chunked-buffer
[![Downloads](https://img.shields.io/npm/dt/chunked-buffer.svg)]()
Small function you can wrap fs.createReadStream with to get fixed size data chunks.
#### Small function you can wrap fs.createReadStream with to get fixed size data chunks.
*chunked-buffer* modifies the stream.Readable 'data' event to make so that chunks will have a fixed amount of bytes instead of getting randomly sized chunks. This can be extremely helpful if the target you pipe to expects a certain amount of bytes or if that target has a byte limitation (a udp packet for example).
### Usage
```javascript
const chunked = require('chunked-buffer')
const rs = chunked(fs.createReadStream('path/to/file'), { chunkSize: 20000 })
const rs = chunked(fs.createReadStream('path/to/file'), { chunkSize: 20000 })
chunked.on('data', (chunk) => {
rs.on('data', (chunk) => {
// chunk is a Buffer with a size of 20000 bytes.
})
```
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