hojas/node_modules/teex/example.js

17 lines
253 B
JavaScript
Raw Permalink Normal View History

2026-05-14 10:56:04 +02:00
const tee = require('./')
const { Readable } = require('streamx')
const s = new Readable()
for (let i = 0; i < 1000; i++) {
s.push(Buffer.alloc(1024))
}
const [a, b] = tee(s)
a.on('data', console.log)
setTimeout(function () {
b.read()
}, 1000)