发布时间:2022-08-09 文章分类:编程知识 投稿人:王小丽 字号: 默认 | | 超大 打印

node-stream-cache

A simple way to cache and replay readable streams.

Usage

var StreamCache = require('stream-cache');
var fs          = require('fs');
var cache = new StreamCache();
fs.createReadStream(__filename).pipe(cache);
// Cache can now be piped anywhere, even before the readable stream finishes.
cache.pipe(process.stdout);