
Security News
AI Agent Lands PRs in Major OSS Projects, Targets Maintainers via Cold Outreach
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.
binary-search-party
Advanced tools
Asynchronous or Synchronous binary search. This can be useful for seraching through really useless databases like a pipermail archive. If you essentially just have a key value store and a list of keys that are known to be in order, you can efficiently search for a specific value using this module.
npm install binary-search-party
var search = require('binary-search-party')
var haystack = [1, 2, 3, 4, 5]
var needle = 4
var index = search(haystack, function (val) {
if (val === needle) return 0
if (val < needle) return -1
if (val > needle) return +1
})
asssert(haystack[index] === needle)
var search = require('binary-search-party')
var haystack = [1, 2, 3, 4, 5]
var needle = 4
search(haystack, function (val, callback) {
if (val === needle) return callback(null, 0)
if (val < needle) return callback(null, -1)
if (val > needle) return callback(null, +1)
}, function (err, index) {
if (err) throw err
asssert(haystack[index] === needle)
})
var search = require('binary-search-party')
var haystack = [1, 2, 3, 4, 5]
var needle = 4
search(haystack, function (val) {
if (val === needle) return Promise.from(null, 0)
if (val < needle) return Promise.from(null, -1)
if (val > needle) return Promise.from(null, +1)
}).done(function (index) {
asssert(haystack[index] === needle)
})
N.B. You will get back the type of promise returned by calling the comparison function. This makes it easy to use your own promise library :)
N.B. If you pass an empty array, the comparison function can never be called so the result will be the literal number -1. If the array might be empty and you rely on the result being a promise you should assimilate the result into being a promise using something like Promise.from(search(arr, comparison))
MIT
FAQs
Asynchronous binary search
We found that binary-search-party 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
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.

Research
/Security News
Chrome extension CL Suite by @CLMasters neutralizes 2FA for Facebook and Meta Business accounts while exfiltrating Business Manager contact and analytics data.

Security News
After Matplotlib rejected an AI-written PR, the agent fired back with a blog post, igniting debate over AI contributions and maintainer burden.