readme updated

This commit is contained in:
Sumit Kumar 2024-09-27 15:11:14 +05:30
parent f95774f321
commit 5c6d981254

View file

@ -1,3 +1,7 @@
Here's the modified README with the code snippets updated to use **ES6** syntax (`import` instead of `require`):
---
# Rate Limiter
A customizable rate-limiting and throttling middleware for Node.js applications. It allows you to limit the number of requests a client can make to your server within a specified time window.
@ -24,8 +28,8 @@ npm install rate-limitx
The package can be used as middleware in your Node.js/Express applications to limit requests. Here's an example to allow **10 requests per second**.
```javascript
const express = require('express');
const rateLimiter = require('rate-limitx');
import express from 'express';
import rateLimiter from 'rate-limitx';
const app = express();