
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
@reverse/random
Advanced tools
Easy random generation.
You can install with nodejs and npm
npm i @reverse/random
Generates a random whole number between two values.
min: Number: The minimum number to generate inclusivly.max: Number: The maximum number to generate inclusivly.import { randomInt } from '@reverse/random';
randomInt(1, 5);
// Example Output: 5
Returns true a percent amount of the time.
percent: Number: The percent chance to return true.import { chance } from '@reverse/random';
chance(100);
// true
chance(0)
// false
chance(50)
// Example Output: true
Returns a random element from an array.
list: Array: The array to pick from.import { randomOf } from '@reverse/random';
randomOf([1, 2, 3]);
// Example Output: 2
Picks multiple values from an array.
list: Array: The array to choose from.items: Number: How many items should be returned. Default 1.requiredValues: Array: The values that have to be in the returned items. Default [].import { randomList } from '@reverse/random';
randomList([1, 2, 3, 4], 1, []);
// Exanple Output: [3]
randomList([1, 2, 3, 4], 2, []);
// Exanple Output: [1, 3]
randomList([1, 2, 3, 4], 3, [3]);
// Exanple Output: [3, 3, 3]
FAQs
Easy random generation.
The npm package @reverse/random receives a total of 10 weekly downloads. As such, @reverse/random popularity was classified as not popular.
We found that @reverse/random demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.