Sign in
chromium
/
devtools
/
devtools-frontend.git
/
refs/heads/main
/
.
/
node_modules
/
teex
/
example.js
blob: bb621839c0994aaea65a988a2baa221670e63511 [
file
] [
edit
]
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
)