simple-lru-cache / 0.0.2 last updated a year ago created on Jan 11th 2013

Install

npm install --save simple-lru-cache

Clone

git clone git@github.com:geisbruch/node-simple-lru-cache.git

dependencies

No dependencies listed.

maintainers

geisbruch

versions

0.0.2 a year ago geisbruch
0.0.1 3 years ago geisbruch
12834 Downloads yesterday.

readme

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
Resolving all dependencies.. This could take a while as our cache is not yet fully warmed up.