mercadolibre/node-simple-lru-cache

Name: node-simple-lru-cache

Owner: MercadoLibre

Description: Simple and Fast LRU cache for node

Forked from: geisbruch/node-simple-lru-cache

Created: 2017-05-19 18:47:18.0

Updated: 2018-03-10 21:45:40.0

Pushed: 2017-06-27 21:26:36.0

Homepage: null

Size: 11

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

node-simple-lru-cache

Build Status

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

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.