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

stream-chunker

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-chunker - npm Package Compare versions

Comparing version 1.2.7 to 1.2.8

8

index.js

@@ -49,6 +49,6 @@ /**

if (opts.align) {
var remaining = new Buffer(chunkSize - buffer.length);
remaining.fill(0);
buffer = Buffer.concat([ buffer, remaining ], chunkSize);
if (opts.align && buffer.length > 0) {
var remaining = new Buffer(chunkSize - buffer.length);
remaining.fill(0);
buffer = Buffer.concat([ buffer, remaining ], chunkSize);
}

@@ -55,0 +55,0 @@

{
"name": "stream-chunker",
"version": "1.2.7",
"version": "1.2.8",
"description": "A transform stream which chunks incoming data into chunkSize byte chunks",

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

@@ -44,4 +44,5 @@ var Chunker = require('../index.js');

test('Test align option', function (t) {
t.plan(1);
t.plan(2);
var optsFlushAlign = {

@@ -64,2 +65,12 @@ flush: true,

function checkAlignedFlushAlign(data) {
t.equals(data, '1234', 'Received flush data');
}
var chunkerAlignedFlushAlign = Chunker(4, optsFlushAlign);
var concatStreamAlignedFlushAlign = concat(checkAlignedFlushAlign);
chunkerAlignedFlushAlign.pipe(concatStreamAlignedFlushAlign);
chunkerAlignedFlushAlign.write('12');
chunkerAlignedFlushAlign.write('34');
chunkerAlignedFlushAlign.end();
});
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