1
0
Fork 0
forked from svrjs/svrjs
This repository has been archived on 2024-11-10. You can view files and clone it, but cannot push or open issues or pull requests.
svrjs/node_modules/simple-lru-cache
2024-08-26 08:36:01 +02:00
..
benckmark Add node_modules 2023-07-29 20:33:28 +02:00
lib Add node_modules 2023-07-29 20:33:28 +02:00
test Add node_modules 2023-07-29 20:33:28 +02:00
.npmignore Add node_modules 2023-07-29 20:33:28 +02:00
index.js Add node_modules 2023-07-29 20:33:28 +02:00
LICENSE Add node_modules 2023-07-29 20:33:28 +02:00
Makefile Add node_modules 2023-07-29 20:33:28 +02:00
package.json Update to SVR.JS 3.15.7 2024-08-26 08:36:01 +02:00
README.md Add node_modules 2023-07-29 20:33:28 +02:00
servers Add node_modules 2023-07-29 20:33:28 +02:00

node-simple-lru-cache

It's a very simple and extremely fast lru cache for node.js.

This cache will priorize the lastest used keys over the least used keys, so when a new key is added if the cache is full, the least used key will be removed

Instalation

npm install simple-lru-cache

Usage

var SimpleCache = require("simple-lru-cache")

var cache = new SimpleCache({"maxSize":1000})

//Add an Objet
cache.set("hello","world")

//Get an Object
cache.get("hello")

//Delete an Object
cache.del("hello")

//Reset cache
cache.reset()

Tests

npm install
npm test

Benchmark against lru-cache

  make bench