@sz-md/async-buffer
v0.3.0
Published
Asynchronous buffer:
Downloads
3
Readme
@sz-md/async-buffer
Asynchronous buffer:
const AsyncBuffer = require("@sz-md/async-buffer")
async function main() {
const buffer = await AsyncBuffer.create()
setTimeout(() => {
buffer.fill([1, 2])
buffer.fill([3, 4, 5])
}, 100)
console.log(await buffer.read(4)) // [1, 2, 3, 4]
console.log(await buffer.read(1)) // [5]
}
main()