
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.
Another range array generator. Written in TypeScript, well tested, no floating-point BS, super fast and tiny.
Another range array generator. Written in TypeScript, well tested, no floating-point BS, super fast and tiny.
yarn add rangestar
Supports generators...
const range = require('rangestar');
for (const r of range.rangeGenerator(3)) {
console.log(r);
}
// 0
// 1
// 2
for (const r of range.rangeGenerator(1, 3)) {
console.log(r);
}
// 1
// 2
...and arrays...
const a = range.rangeArray(3);
console.log(a);
// [0, 1, 2]
const b = rangeArray(3, 3.4, 0.1);
console.log(b);
// [3, 3.1, 3.2, 3.3]
...and humans:
const lodashRange = require('lodash.range');
const c = lodashRange(3, 3.4, 0.1);
console.log(c);
// [3, 3.1, 3.2, 3.3000000000000003]
// WHAT THE F$#%?
The START value will be included in the result, while STOP will not.
// From 0 to STOP:
range.rangeGenerator(STOP: number): Generator<number>
// From START to STOP with optional STEP:
range.rangeGenerator(START: number, STOP: number, STEP?: number): Generator<number>
Same concept.
// From 0 to STOP:
range.rangeGenerator(STOP: number): number[]
// From START to STOP with optional STEP:
range.rangeGenerator(START: number, STOP: number, STEP?: number): number[]
Use yarn benchmark to run the benchmarks. Python and Bash are required.
| Library | Results |
|---|---|
| Range* | 14.424ms |
| Lodash | 13.017ms |
| range | 19.874ms |
Python range | 20.853ms |
This library is based on Lodash's range function.
FAQs
Another range array generator. Written in TypeScript, well tested, no floating-point BS, super fast and tiny.
We found that rangestar 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.