npm

Need private packages and team management tools?Check out npm Orgs. »

simple-lru-cache

0.0.2 • Public • Published

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

install

npm i simple-lru-cache

Downloadsweekly downloads

91,305

version

0.0.2

license

none

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability