/x-rate

Adhere to x-rate-limit headers

Primary LanguageJavaScriptGNU General Public License v2.0GPL-2.0

x-rate

Circle CI

Install

npm install x-rate --save

About

Use request and adhere to X-Rate-Limit headers.

X-Rate-Limit-Limit: 60
X-Rate-Limit-Remaining: 25
X-Rate-Limit-Reset: 8

Use

var request = require('request');
var Xrate = require('x-rate');
var xRate = new Xrate(request, queueDoneCallback);
var req = xRate.getMethod();
for (var i = 0; i < 10; i++) {
  req({ url: 'localhost' }, function (err, res, body) {
  });
}