
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.
searchable-record-cache
Advanced tools
A record cache with Hamming distance-based similarity search.
npm install searchable-record-cache
const { SearchableRecordCache, SearchableBucketRecordCache } = require('searchable-record-cache')
// Basic cache - scans all documents
const cache = new SearchableRecordCache({
maxAge: 60000, // optional, default Infinity
maxSize: 10000 // optional, default Infinity
})
cache.add(simhashKey, value)
const results = cache.search(queryHash, {
closest: 10, // number of results
values: 10, // values per key
maxScan: 10000 // limit scan size
})
// Bucket cache - faster for large datasets
const bucketCache = new SearchableBucketRecordCache({
prefixBytes: 2 // bucket by first N bytes
})
bucketCache.add(simhashKey, value)
const results = bucketCache.search(queryHash, {
closest: 10,
values: 10,
prefixRadius: 2 // max Hamming distance for prefix matching
})
new SearchableRecordCache(opts?)maxAge - max age in ms before evictionmaxSize - max number of entriescache.add(key, value)Add a value under a Buffer key (e.g., a SimHash).
cache.search(id, opts?)Find keys closest to id by Hamming distance. Returns [{ key, distance, values }].
new SearchableBucketRecordCache(opts?)Like SearchableRecordCache but buckets keys by prefix for faster lookups on large datasets.
prefixBytes - number of prefix bytes for bucketing (default: 2)cache.destroy()Clean up resources.
Apache-2.0
FAQs
searchable-record-cache
The npm package searchable-record-cache receives a total of 7 weekly downloads. As such, searchable-record-cache popularity was classified as not popular.
We found that searchable-record-cache demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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.