az-rate-limit

2.0.3 • Public • Published

az-rate-limit

Hello I am Aawez Khan(Nodejs Community Lead Developer) aawez@nodejs.community.

Caching is a commonly used technique to improve the performance of any application

Cache a route Ready to use sample

var cacheService = require("az-rate-limit");
var client = cacheService.cache;

app.get("/", client("1 minutes"), (req, res) => {
  // retrieve data and request before 1 minutes will get data from cache
  res.json([
	your response
  ]);
});

app.listen(5000, function () {
  console.log(`Example app listening on 3000!`);
});

API

  • valid units - ms, second, minute, hour, day, week, month.
  • duration format - [time][unit] as 5 minutes

Package Sidebar

Install

npm i az-rate-limit

Weekly Downloads

2

Version

2.0.3

License

MIT

Unpacked Size

5.39 kB

Total Files

7

Last publish

Collaborators

  • aawezkhan