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

stream-buffers

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stream-buffers - npm Package Compare versions

Comparing version 0.2.4 to 0.2.5

.travis.yml

2

lib/constants.js

@@ -6,2 +6,2 @@ module.exports = {

DEFAULT_CHUNK_SIZE: 1024
};
};

@@ -19,3 +19,3 @@ var stream = require("stream"),

var encoding = null;
this.readable = true;

@@ -42,3 +42,3 @@ this.writable = false;

if((size + amount) < buffer.length)
if(amount < buffer.length)
buffer.copy(buffer, 0, amount, size);

@@ -49,3 +49,3 @@ size -= amount;

this.size = function() {
return size;
return size;
};

@@ -60,3 +60,3 @@

var factor = Math.ceil((incomingDataSize - (buffer.length - size)) / incrementAmount);
var newBuffer = new Buffer(buffer.length + (incrementAmount * factor));

@@ -84,3 +84,3 @@ buffer.copy(newBuffer, 0, 0, size);

};
this.pause = function() {

@@ -92,3 +92,3 @@ if(sendData) {

};
this.resume = function() {

@@ -99,6 +99,6 @@ if(sendData && !sendData.interval) {

};
this.destroy = function() {
that.emit("end");
sendData.interval && clearTimeout(sendData.interval);
if(sendData.interval) clearTimeout(sendData.interval);
sendData = null;

@@ -105,0 +105,0 @@ that.readable = false;

module.exports = require("./constants");
module.exports.ReadableStreamBuffer = require("./readable_streambuffer");
module.exports.WritableStreamBuffer = require("./writable_streambuffer");
module.exports.WritableStreamBuffer = require("./writable_streambuffer");

@@ -25,7 +25,7 @@ var util = require("util"),

};
this.maxSize = function() {
return buffer.length;
};
this.getContents = function(length) {

@@ -36,3 +36,3 @@ if(!size) return false;

buffer.copy(data, 0, 0, data.length);
if(data.length < size)

@@ -62,3 +62,3 @@ buffer.copy(buffer, 0, data.length);

var factor = Math.ceil((incomingDataSize - (buffer.length - size)) / incrementAmount);
var newBuffer = new Buffer(buffer.length + (incrementAmount * factor));

@@ -69,3 +69,3 @@ buffer.copy(newBuffer, 0, 0, size);

};
this.write = function(data, encoding) {

@@ -86,3 +86,3 @@ if(!that.writable) return;

};
this.end = function() {

@@ -93,3 +93,3 @@ var args = Array.prototype.slice.apply(arguments);

};
this.destroySoon = this.destroy = function() {

@@ -100,2 +100,2 @@ that.writable = false;

};
util.inherits(WritableStreamBuffer, stream.Stream);
util.inherits(WritableStreamBuffer, stream.Stream);
{
"name": "stream-buffers",
"version": "0.2.4",
"version": "0.2.5",
"description": "Buffer-backed Streams for reading and writing.",

@@ -17,3 +17,6 @@ "keywords": "memory streams, buffer streams",

"url" : "https://github.com/samcday/node-stream-buffer.git"
}
},
"scripts": {
"test": "vows --spec"
}
}

@@ -1,3 +0,5 @@

# Node Stream Buffers
# Node Stream Buffers `v0.2.5`
[![Build Status](https://travis-ci.org/samcday/node-stream-buffer.png)](https://travis-ci.org/samcday/node-stream-buffer)
... For lack of a cooler (or less confusing) name.

@@ -4,0 +6,0 @@

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