
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@vates/stream-reader
Advanced tools
Efficiently reads and skips chunks of a given size in a stream
Installation of the npm package:
npm install --save @vates/stream-reader
import StreamReader from '@vates/stream-reader'
const reader = new StreamReader(stream)
.read([size])stream.read(), a number of bytes can be specifiednull if the stream has ended and no data has been readconst chunk = await reader.read(512)
.readStrict([size])Similar behavior to readChunk but throws if the stream ended before the requested data could be read.
const chunk = await reader.readStrict(512)
.skip(size)Skips a given number of bytes from a stream.
Returns the number of bytes actually skipped, which may be less than the requested size if the stream has ended.
const bytesSkipped = await reader.skip(2 * 1024 * 1024 * 1024)
.skipStrict(size)Skips a given number of bytes from a stream and throws if the stream ended before enough stream has been skipped.
await reader.skipStrict(2 * 1024 * 1024 * 1024)
Contributions are very welcomed, either on the documentation or on the code.
You may:
FAQs
Efficiently reads and skips chunks of a given size in a stream
We found that @vates/stream-reader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.