Skip to content

kelcon/liftcache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lift cache

It it very simple caching system connected with key/value database on top of levelup database. Just define function that returns value for some parameter (ie. fetches and parsers some URL endpoint) and lift cache will do the rest. Next time you call cache with the same parameter, you will receive cached value.

var agent = function(resource,done) {     
    var err = null;
    var val = Math.random(); // value to save and link with resource
    done(err, val);
});

var cache = liftcache({
    path: './put_cache_db_in_that_dir', 
    agent: agent
});

// usage:
cache('somekey',function(err,val) console.log('Random for somekey is '+val); });

About

Easy caching system on top of Level database

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published