
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
A lightweight, as in 1.2K, Map based LRU implementation.
import LRU from 'basic-lru';
const LRU = require('basic-lru');
// https://unpkg.com/basic-lru to have LRU globally
// new LRU(maxSize)
const lru = new LRU(100);
// new LRU({max}) or new LRU({maxSize})
const lru = new LRU({max: 1000});
// new LRU({maxAge}) in milliseconds
const lru = new LRU({maxAge: 1000});
// variants
const lru = new LRU({max: 100, maxAge: 1000});
const lru = new LRU({maxSize: 100, maxAge: 1000});
This module is a drop-in replacement for any Map instance, and it's mostly 100% compatible with lru, lru-cache, quick-lru, and lru-map modules.
Differently from other modules, this one has the least amount of LOC, zero dependencies, and it's based on ES2015 class capability to extend the native Map.
The only difference from a real Map, beside implementing a classic LRU cache, is the peek(key) method, to access an entry without flagging its access time anyhow, and borrowed from other libraries, plus a constructor, also borrowed from other libraries, that accepts either an integer, or an options object with max, or maxSize, and a maxAge property, where all of these are optional too.
FAQs
A fast and lightweight Map based LRU implementation.
The npm package basic-lru receives a total of 7 weekly downloads. As such, basic-lru popularity was classified as not popular.
We found that basic-lru 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.

Research
/Security News
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.