
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.
weighted-round-robin
Advanced tools
A simple weighted round robin load balance module. Algorithm is similar to Nginx.
##Install:
npm install weighted-round-robin
##Usage: Example:
var Peers = require('weighted-round-robin');
var peers = new Peers();
peers.add({
server:"192.168.1.1:80",
weight:90
});
peers.add({
server:"192.168.1.2:80",
weight:10
});
peers.add({
server:"192.168.1.3:80",
weight:10
});
// many more
for(var i = 0; i < 20 ; i++ ){
console.info(peers.get().server);
}
###peers.add( object )
returns id for the peers, notice that the object will be modified, you'd better clone it if you want to keep the original value.
###peers.get()
returns a peer according to the algorithm.
###peers.reset()
reset all peers' chance.
###peers.each( fn , context )
iterates over all peers, the fn is bound to the context object.
###peers.remove( key )
remove the peer.
###peers.remove( fn )
remove the peer when the fn returns true.
###peers.size()
return the size of the peers.
FAQs
a weighted round robin module
The npm package weighted-round-robin receives a total of 299 weekly downloads. As such, weighted-round-robin popularity was classified as not popular.
We found that weighted-round-robin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.