0.1.0 • Published 11 years ago

cache-advice v0.1.0

Weekly downloads
24
License
-
Repository
github
Last release
11 years ago

Cache Advice

by Matthew Lyon matthew@lyonheart.us

A node.js module for caching the results of functions that take callbacks. The caching mechanism is pluggable, by default will use lru-cache

Example

var cacher = require('cache-advice')()
  , reader = cacher.get(fs.readFile)
  ;

setTimeout(function(){
  reader('README.md', 'utf8')
  // will pull the result from fs.readFile, store in cache
  // by default uses the first argument as the cache key
  }, 1000);

setTimeout(function(){
  reader('README.md', 'utf8')
  // will check the cache first, if found will serve from that
  // fs.readFile will not get called
  }, 2000);

Alternate Caching Modules

lru-cache:

0.1.0

11 years ago

0.0.6

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago