
Security News
The Next Open Source Security Race: Triage at Machine Speed
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.
static-range-query
Advanced tools
Given a collection of points in n-dimensional space, preprocesses these points so that orthogonal range queries can be computed efficiently. Internally, this library is built using range trees.
var preprocess = require("static-range-query")
//Generate 10000 4D points
var D = 4, N = 10000
var points = new Array(N)
for(var i=0; i<N; ++i) {
var p = new Array(D)
for(var j=0; j<N; ++j) {
p[j] = Math.random() * 1000
}
points[i] = p
}
//Construct query data structure
var rangeQuery = preprocess(points)
//Now execute a range query!
rangeQuery([2, 5, 0.25, -10], [10, 50, 5, 30], function(i) {
console.log("In range: ", i , points[i])
})
npm install static-range-query
var rangeQuery = require("static-range-query")(points)Preprocesses the point set so that orthogonal range queries can be evaluated efficiently.
points is an array of points (each point is represented as a tuple of D numbers)Returns A rangeSearch() function (see below) which evaluates range queries on the point set.
Time Complexity O(points.length * log(points.length)^points[0].length)
Space Complexity O(points.length * log(points.length)^points[0].length)
Notes Internally, this function builds a range tree and binds it to the query method
rangeQuery(lo, hi, cb(index))Evaluates a range query on the point set.
lo is a lower bound on the bounding rectangle to queryhi is an upper bound on the bounding rectangle to querycb is a callback which gets called once per each point in the range with the index of a point.Time Complexity O(log(points.length)^points[0].length + k) where k is the number of points processed in the range.
Note You can terminate the search early by returning true from cb, for example:
rangeQuery([0, 0, 0], [100, 100, 100], function(i) {
if(i === 100) {
console.log("found it!")
return true
}
//Continue processing ....
return false
})
(c) 2013 Mikola Lysenko. MIT License
FAQs
Fast n-dimensional orthogonal range searches for static point sets
We found that static-range-query 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
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.

Research
/Security News
Malicious dYdX client packages were published to npm and PyPI after a maintainer compromise, enabling wallet credential theft and remote code execution.

Security News
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.