cachedrequest
v1.3.0
Published
Cache addon for node's popular request module
Downloads
4
Readme
Cached request version
Allow you send cached requests. Depends on "request" module https://github.com/request/request/. No extra configuration needed.
Installation
$ npm install -s cachedrequest
Simple:
var request = require('cachedrequest');
request.cached('http://www.comlog.org', function(err, response, body) {
console.info(response);
});
Set cache direcotry:
var request = require('cachedrequest');
request.setCacheDirectory('/my/path/to/cache/folder');
request.cached('http://www.comlog.org', function(err, response, body) {
console.info(response);
});
Clear cache:
var request = require('cachedrequest');
request.setCacheDirectory('/my/path/to/cache/folder'); // if not standard
request.clearCache(function(errors, removed) {
console.error(errors);
console.info(removed);
});