
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
@nxtedition/ranges
Advanced tools
Merge and subtract numeric ranges. Useful for byte ranges, time ranges, and similar interval arithmetic.
Merge and subtract numeric ranges. Useful for byte ranges, time ranges, and similar interval arithmetic.
npm install @nxtedition/ranges
import { merge } from '@nxtedition/ranges'
merge([
[10, 20],
[15, 30],
[50, 60],
])
// [[10, 30], [50, 60]]
import { subtract } from '@nxtedition/ranges'
subtract(
[[0, 100]],
[
[10, 20],
[30, 40],
],
)
// [[0, 10], [20, 30], [40, 100]]
merge(ranges: Range[]): readonly Range[]Sorts and merges overlapping or adjacent ranges. Returns a new array of non-overlapping ranges. Invalid ranges (empty, reversed, non-finite) are filtered out.
subtract(a: readonly Range[], b: readonly Range[]): readonly Range[]Subtracts ranges b from ranges a. Returns the remaining intervals. Does not modify the input arrays.
Rangetype Range = readonly [start: number, end: number]
Ranges are half-open intervals: start is inclusive, end is exclusive.
MIT
FAQs
Merge and subtract numeric ranges. Useful for byte ranges, time ranges, and similar interval arithmetic.
We found that @nxtedition/ranges demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 10 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.

Research
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.