@stream-toolbox/null
v1.0.0
Published
Create a writable stream that will swallow all data, somewhat similar to /dev/null, but with some extra features.
Downloads
6
Maintainers
Readme
@stream-toolbox/null
🕳️ Create a writable stream that will swallow all data, somewhat similar to /dev/null, but with some extra features.
Installation
npm i @stream-toolbox/null
Quick Start
Read data from readable as fast as possible:
const createNull = require("@stream-toolbox/null");
const { createReadStream } = require("fs");
createReadStream("some_file").pipe(createNull());
Read data from readable with speed limit:
const createNull = require("@stream-toolbox/null");
const { createReadStream } = require("fs");
createReadStream("some_file").pipe(createNull(1024)); // 1024 bytes per second
API
createNull(bytesPerSecond?: number): Writable
安装
npm i @stream-toolbox/null
快速开始
尽可能快地从可读流中读取数据:
const createNull = require("@stream-toolbox/null");
const { createReadStream } = require("fs");
createReadStream("some_file").pipe(createNull());
有速度限制的从可读流中读取数据:
const createNull = require("@stream-toolbox/null");
const { createReadStream } = require("fs");
createReadStream("some_file").pipe(createNull(1024)); // 1024 字节每秒
API
createNull(bytesPerSecond?: number): Writable