Socket
Book a DemoInstallSign in
Socket

buffered2

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buffered2

Buffered stream which saves data until it is piped somewhere

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

buffered2

Buffered stream which saves data until it is piped somewhere.

This module mainly exists to account for that fact that incoming HTTP requests aren't buffered and can result in data loss if they aren't piped somewhere synchronously.

Inspired by @mmalecki's buffered module. Basically the same functionality, but with a newer streams backing.

Install

npm install buffered2

Example

"use strict";
var fs = require("fs");
var http = require("http");
var BufferedStream = require("buffered2").BufferedStream;

http.createServer(function (req, res) {
	var buffer = new BufferedStream();
	req.pipe(buffer);
	setTimeout(function () {
		buffer.pipe(fs.createWriteStream('req'));
	}, 500);
}).listen(8000);

Keywords

buffer

FAQs

Package last updated on 12 Sep 2016

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