329 B
329 B
- returns the next available chunk of data
- like
stream.read(), a number of bytes can be specified - returns
nullif the stream has ended
import { readChunk } from '@vates/read-chunk'
;(async () => {
let chunk
while ((chunk = await readChunk(stream, 1024)) !== null) {
// do something with chunk
}
})()