buffered-stream

A writable and readable stream with bufferisation

This module create a Stream which implement both the writer and reader API. The content written to the stream is buffered at a defined size and later flushed into the final destination stream. Use the buffered stream to increase writing speed.

Quick example

The example below will buffer the data from i readable stream and send them to a writeable stream as 16 Mo chunks.

buffered = require('buffered-stream');

reader = createStreamReader();
buffer = buffered(4*1024*1024);
writer = createStreamWriter();

reader.pipe(buffer).pipe(writer);

Development

Tests are executed with mocha. To install it, simple run npm install, it will install mocha and its dependencies in your project "node_modules" directory.

To run the tests:

npm test

The tests run against the CoffeeScript source files.

To generate the JavaScript files:

make build

The test suite is run online with Travisagainst Node.js version 0.6, 0.7, 0.8 and 0.9.

Contributors

HomePage

http://www.adaltas.com/projects/node-buffered-stream/

Repository

https://github.com/wdavidw/node-buffered-stream


上一篇:flon
下一篇:oe-connector-oracle

相关推荐

  • 理解 Node.js Stream 模块

    流概念是学习 Node 绕不过去的概念之一,它的底层代码也非常复杂,它能够优化对于文件或者数据处理的内存优化与流程优化,本文主要是讲述了对于 Stream 的实现与使用。

    2 年前
  • 深入nodejs中流(stream)的理解

    流的基本概念及理解 流是一种数据传输手段,是有顺序的,有起点和终点,比如你要把数据从一个地方传到另外一个地方 流非常重要,gulp,webpack,HTTP里的请求和响应,http里的sock...

    2 年前
  • 浅析Node.js的Stream模块中的Readable对象

    我一直都很不愿意扯 nodejs 的流,因为从第一次看到它我就觉得它的设计实在是太恶心了。但是没办法,Stream 规范(https://streams.spec.whatwg.org/)尚未普及,而...

    3 年前
  • 对fs.createreadstream VS fs.readfile Node.js的利弊是什么?

    Kent Brewster(https://stackoverflow.com/users/1151280/kentbrewster)提出了一个问题:What are the pros and con...

    2 年前
  • 学Node必须掌握的Buffer和Stream

    本文并不介绍 Buffer 和 Stream 使用的api,而是把对 Buffer 和 Stream 的理解带给大家。 之前发了篇文章《Nodejs核心模块简介》(https://segmentfa...

    9 个月前
  • 在 Flutter 里使用 Stream

    前言 在 Flutter 中有两种处理异步操作的方式 Future 和 Stream,Future 用于处理单个异步操作,Stream 用来处理连续的异步操作。比如往水杯倒水,将一个水杯倒满为一个 F...

    1 个月前
  • 【每日一包0023】concat-stream

    github地址:https://github.com/ABCDdouyae...(https://github.com/ABCDdouyaer/apackperdayNO.1) concatst...

    1 年前
  • 【每日一包0022】through2-map,through2-filter,stream-spigot

    github地址:https://github.com/ABCDdouyae...(https://github.com/ABCDdouyaer/apackperdayNO.1) through2...

    1 年前
  • zipstream

    Creates ZIP output streams. zipstream Creates ZIP output streams. Depends on Node's buildin zlib...

    1 年前
  • zip-stream

    a streaming zip archive generator. ZipStream Build Status(https://travisci.org/archiverjs/nodezips...

    1 年前

官方社区

扫码加入 JavaScript 社区