@sz-sw/async-buf

1.0.2 • Public • Published

@sz-sw/async-buf

Asynchronous buffer:

const AsyncBuffer = require("@sz-sw/async-buf")

const buffer = AsyncBuffer.create()

async function main() {
	console.log(await buffer.read(4)) // [1, 2, 3, 4]
	console.log(await buffer.read(1)) // [5]
}

setTimeout(() => {
	buffer.fill([1, 2])
	buffer.fill([3, 4, 5])
}, 100)

main()

Readme

Keywords

none

Package Sidebar

Install

npm i @sz-sw/async-buf

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

2.42 kB

Total Files

4

Last publish

Collaborators

  • sz-coder