@anyplot/lru
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@AnyPlot/lru

🧩 Nano (~400 bytes) & O(1) performance LRU library.

Build Status Coverage Status npm Version npm Download npm License

Usage

import LRU from '@anyplot/lru';

const lru = new LRU(3);
lru.set('a', 1);
lru.set('b', 2);
lru.set('c', 3);

lru.size();                 // 3
lru.get('a');               // 1
lru.get('b');               // 2

lru.set('d', 4);

lru.peer('a');              // 1
lru.peer('b');              // 2
lru.peer('c');              // undefined
lru.peer('d');              // 4

License

MIT@hustcc.

Readme

Keywords

Package Sidebar

Install

npm i @anyplot/lru

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

20.6 kB

Total Files

11

Last publish

Collaborators

  • atool