
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.
java-util-random
Advanced tools
A recreation of Java's java.util.Random, with full support for BigInts. Streams not supported yet.
A recreation of Java's java.util.Random class in Node.js.
Yes, I know there's already java-random, however the code is quite old, it doesn't fully support BigInts, and it doesn't have any typings. This library should be able to meet your needs. If you find any bugs, feel free report it on the issue tracker!
This module was written in TypeScript, so importing it in regular JavaScript is going to need a bit of an extra step.
const Random = require('java-util-random').default;
const random = new Random();
import Random from 'java-util-random';
const random = new Random();
.nextFloat() returns a value inaccurate to what Java returns.
I'm not quite sure how to fix this issue, so if you know how, please feel free to PR.The values of nextFloat() are now mostly accurate to Java floats, however there are occasionally fairly small precision issues.
There are no streams.
I haven't bothered to try implementing them yet, however in the near future I might.
FAQs
A recreation of Java's java.util.Random, with full support for BigInts. Streams not supported yet.
The npm package java-util-random receives a total of 59 weekly downloads. As such, java-util-random popularity was classified as not popular.
We found that java-util-random 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.