An open API service indexing awesome lists of open source software.

https://github.com/hua1995116/lru-node-addon

A native module for Node supporting LRU (least-recently-used).
https://github.com/hua1995116/lru-node-addon

lru-cache node-addon

Last synced: 4 months ago
JSON representation

A native module for Node supporting LRU (least-recently-used).

Awesome Lists containing this project

README

          

# lru-node-addon

A native module for Node supporting LRU (least-recently-used).

# usage

```javascript
const List = require("lru-node-addon");

const list = new List();
list.SetMax(10);

list.Insert("10", "hello");
list.Insert("1 1", "world");
list.Insert("12", "hi1");
list.Insert("13", "hi2");
list.Insert("14", "hi3");
list.Insert("15", "hi4");
list.Insert("16", "hi5");
list.Insert("17", "hi6");
list.Insert("18", "hi7");
list.Insert("19", "hi8");
list.Insert("20", "hi9");
list.Insert("21", "hi10");

console.log(list.Search("10"));
console.log(list.Print());
```