
Security News
TC39 Advances Temporal to Stage 4 Alongside Several ECMAScript Proposals
TC39’s March 2026 meeting advanced eight ECMAScript proposals, including Temporal reaching Stage 4 and securing its place in the ECMAScript 2026 specification.
Generate a random integer
npm install random-int
import randomInteger from 'random-int';
randomInteger(5);
//=> 3
randomInteger(10, 100);
//=> 54
Returns an integer from 0 to maximum.
Returns an integer from minimum to maximum.
If minimum is greater than maximum, the values are swapped to return an integer from the lower value to the higher value.
Type: number
Default: 0
Minimum integer to return.
Type: number
Default: 1
Maximum integer to return.
The 'random' package provides a variety of random number generation functions, including integers, floats, and booleans. It offers more flexibility and options compared to 'random-int'.
The 'random-number-csprng' package generates cryptographically secure random numbers. It is suitable for applications that require high security, such as cryptographic applications, and offers more security compared to 'random-int'.
The 'lodash' package is a utility library that provides a wide range of functions, including random number generation. The 'lodash' random function can generate random integers and floats, offering more versatility compared to 'random-int'.
FAQs
Generate a random integer
The npm package random-int receives a total of 186,437 weekly downloads. As such, random-int popularity was classified as popular.
We found that random-int demonstrated a healthy version release cadence and project activity because the last version was released less than 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
TC39’s March 2026 meeting advanced eight ECMAScript proposals, including Temporal reaching Stage 4 and securing its place in the ECMAScript 2026 specification.

Research
/Security News
Since January 31, 2026, we identified at least 72 additional malicious Open VSX extensions, including transitive GlassWorm loader extensions targeting developers.

Research
Six malicious Packagist packages posing as OphimCMS themes contain trojanized jQuery that exfiltrates URLs, injects ads, and loads FUNNULL-linked redirects.