Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

basic-lru

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

basic-lru

A lightweight Map based LRU implementation

npmnpm
Version
0.1.0
Version published
Weekly downloads
11
120%
Maintainers
1
Weekly downloads
 
Created
Source

basic-lru

Build Status Coverage Status

A lightweight Map based LRU implementation.

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 Map Extend Differences

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.

Keywords

lru

FAQs

Package last updated on 04 Feb 2020

Did you know?

Socket

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.

Install

Related posts