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.5 to 0.2.6

.mailmap

18

lib/readable_streambuffer.js

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

opts = opts || {};
var frequency = opts.frequency || constants.DEFAULT_FREQUENCY;
var frequency = opts.hasOwnProperty("frequency") ? opts.frequency : constants.DEFAULT_FREQUENCY;
var chunkSize = opts.chunkSize || constants.DEFAULT_CHUNK_SIZE;

@@ -26,4 +26,4 @@ var initialSize = opts.initialSize || constants.DEFAULT_INITIAL_SIZE;

if(!size) {
that.emit("end");
return;
that.emit("end");
return;
}

@@ -81,6 +81,13 @@

}
if (!this.isPaused && !frequency) {
while (size > 0) {
sendData();
}
}
};
this.pause = function() {
if(sendData) {
this.isPaused = true;
if(sendData && sendData.interval) {
clearInterval(sendData.interval);

@@ -92,3 +99,4 @@ delete sendData.interval;

this.resume = function() {
if(sendData && !sendData.interval) {
this.isPaused = false;
if(sendData && !sendData.interval && frequency > 0) {
sendData.interval = setInterval(sendData, frequency);

@@ -95,0 +103,0 @@ }

{
"name": "stream-buffers",
"version": "0.2.5",
"description": "Buffer-backed Streams for reading and writing.",
"keywords": "memory streams, buffer streams",
"author": "Sam Day <sam.c.day@gmail.com>",
"main": "./lib/streambuffer.js",
"engines": { "node": ">= 0.3.0" },
"dependencies": {
},
"devDependencies": {
"vows": ">= 0.5.6"
},
"repository" : {
"type" : "git",
"url" : "https://github.com/samcday/node-stream-buffer.git"
},
"scripts": {
"test": "vows --spec"
}
"name": "stream-buffers",
"version": "0.2.6",
"description": "Buffer-backed Streams for reading and writing.",
"keywords": [
"memory streams",
"streams",
"buffer streams"
],
"author": "Sam Day <me@samcday.com.au>",
"main": "./lib/streambuffer.js",
"engines": {
"node": ">= 0.3.0"
},
"dependencies": {},
"devDependencies": {
"vows": ">= 0.5.6"
},
"repository": {
"type": "git",
"url": "https://github.com/samcday/node-stream-buffer.git"
},
"scripts": {
"test": "vows --spec"
},
"publishConfig": {
"registry": "https://registry.npmjs.org"
}
}

@@ -85,3 +85,3 @@ # Node Stream Buffers `v0.2.5`

myReadableStreamBuffer.put("A String", "utf8");
Chunks are pumped out via standard readable stream spec:

@@ -94,2 +94,4 @@

Chunks are pumped out by the interval that you specified in frequency. Setting the frequency to 0 will immediately stream the data (also in chunks). This is useful for unit testing.
setEncoding() for streams is respected too:

@@ -96,0 +98,0 @@

Sorry, the diff of this file is not supported yet

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