docs(read-chunk): behavior when stream has ended

This commit is contained in:
Julien Fontanet 2022-06-13 11:22:42 +02:00
parent ee2117abf6
commit cda027b94a
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,7 @@
- returns the next available chunk of data
- like `stream.read()`, a number of bytes can be specified
- returns `null` if the stream has ended
- returns with less data than expected if stream has ended
- returns `null` if the stream has ended and no data has been read
```js
import { readChunk } from '@vates/read-chunk'

View File

@ -18,7 +18,8 @@ Installation of the [npm package](https://npmjs.org/package/@vates/read-chunk):
- returns the next available chunk of data
- like `stream.read()`, a number of bytes can be specified
- returns `null` if the stream has ended
- returns with less data than expected if stream has ended
- returns `null` if the stream has ended and no data has been read
```js
import { readChunk } from '@vates/read-chunk'