
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/generator-toolbox
Advanced tools
Installation of the npm package:
npm install --save @vates/generator-toolbox
A toolbox to ease the use of generator
wrap a source async generator to have it throw an error when timeout is reached timeout is a positive number in milliseconds
import { Timeout } from '@vates/generator-toolbox'
const wrappedGenerator = new Timeout(sourceGenerator, timeout)
wrap a source async generator to have it respect a max speed ( in bytes per seconds). speed is either a strictly positive number or a function returning a strictly positive number. A speed change will be used for the next emitted packet.
The source generator must yield object with a length property.
Optimized for small yields regarding to the speed, since it won't split incoming packet.
If the generator reached the max speed it will be paused, limiting memory consumption.
import { Throttle } from '@vates/generator-toolbox'
const wrappedGenerator = new Throttle(sourceGenerator, speed)
Fork a generator. The rules are:
import { Synchronized } from '@vates/generator-toolbox'
async function consume(generator: AsyncGenerator) {
for await (const val of generator) {
console.log({ val })
}
}
const forker = new Synchronized(generator)
const first = forker.fork('first')
const second = forker.fork('second')
await Promise.all([consume(first), consume(second)])
Note: you can stop early a generator by calling generator.return(), and you can stop in in error by calling generator.throw(error)
Contributions are very welcomed, either on the documentation or on the code.
You may:
FAQs
<!-- DO NOT EDIT MANUALLY, THIS FILE HAS BEEN GENERATED -->
The npm package @vates/generator-toolbox receives a total of 170 weekly downloads. As such, @vates/generator-toolbox popularity was classified as not popular.
We found that @vates/generator-toolbox demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 16 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.