test-action-debian-package/node_modules/sonic-boom/fixtures/firehose.js

23 lines
303 B
JavaScript
Raw Normal View History

2020-03-26 14:37:35 +00:00
'use strict'
const SonicBoom = require('..')
const out = new SonicBoom(process.stdout.fd)
const str = Buffer.alloc(1000).fill('a').toString()
let i = 0
function write () {
if (i++ === 10) {
return
}
if (out.write(str)) {
write()
} else {
out.once('drain', write)
}
}
write()