GitXplorerGitXplorer
m

make_cache.js

public
2 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
3670c892f7748bf5e42c74f03205c0e59af0234b

Merge branch 'development'

mmarcusphillips committed 14 years ago
Unverified
a2916864e2e10c83072920bb18283d04f4b4f15b

inert

mmarcusphillips committed 14 years ago
Unverified
019427e299c8fcd0c31f1e350882441141ba45e2

testing github

mmarcusphillips committed 14 years ago
Unverified
9c8f0314b1b05f904ae616d176a922c988a7180c

adding hot date for precision

mmarcusphillips committed 14 years ago
Unverified
e5926134d0a23f4c5aa227a18d9331ce57c93df4

Merge branch 'development'

mmarcusphillips committed 14 years ago
Unverified
359a4ccbc667f0f44a5e2687ecc28eac04529ffe

Added a readme

mmarcusphillips committed 14 years ago

README

The README file for this repository.

makeCache allows you to generate caching objects with timed expirey and LRU eviction.

Examples:

// Items can expire var cache = makeCache(); cache.get('a'); // => undefined cache.set('a', 1, {expireIn:1000}); cache.get('a'); // => 1 setTimeout(function(){ cache.get('a'); // => undefined }, 1100);

// Caches can be limited in size // Least-recently-used items will evict automatically var smallCache = makeCache({limit:2}); smallCache.set('a', 1); smallCache.get('a'); // => 1 smallCache.set('b', 2); smallCache.set('c', 3); smallCache.get('a'); // => undefined