node-th-cached-request
v0.9.1
Published
node-th-cached-request - Request cache & limit
Downloads
2
Readme
node-th-cached-request
Request cache & limit
Send request to url address and store output into cache file. If cache file exists - read and return response from cache file.
Request count is limited for 10 connections ontime. Next requests is buffered and automatically send after some free connections present.
Installation:
- Copy project directory into node_modules or clone with Git
- Add code below into Your project
Basic usage:
var cachedRequest = require('th-cached-request').cachedRequest;
cachedRequest({
url: s_url
}, function (s_error, s_response, s_data) {
if(s_error) {
console.log('REQUEST ERROR !', error, 'Response:', s_response);
return false;
}
if(!s_data) {
console.log('Data empty !!!', s_error);
return false;
}
console.log(s_data);
});