LRU-memory-cache
Simple in-memory cache implementation for Node.js
Installation
npm install --save LRU-memory-cache
Usage example
var MemoryCache = ; // Create cachevar cache = ; // Get/set valuevar val = cache; // undefinedcache;val = cache; // 'value' // Delete valuecache;val = cache; // undefined // Set value which will expire after 1 secondcache;; cache;; ; // each get move 'used' timestamp further. So TTL means time-from-last-use. LRU cache.
Running tests
npm install
npm test