latency-stream

A stream that can mimic network latency

MIT 2 个版本
安装
npm install latency-stream
yarn add latency-stream
pnpm add latency-stream
bun add latency-stream
README

latency-stream

A stream that can mimic network latency.

npm install latency-stream

Usage

const LatencyStream = require('latency-stream')

const latency = new LatencyStream(100) // add a 100ms of latency

someStream.pipe(latency).pipe(someDestination)

You can also set an interval of latency and it will pick a random number inbetween

const latency = new LatencyStream([100, 200]) // add between 100-200 ms of latency

License

MIT

版本列表
1.0.0 2020-02-04
0.0.0 2020-02-04