Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 28, 2024 via pnpm

express-rate-limit 7.0.1

Basic IP rate-limiting middleware for Express. Use to limit repeated requests to public APIs and/or endpoints such as password reset.
Package summary
Share
0
issues
3
licenses
62
MIT
2
ISC
1
BSD-3-Clause
Package created
11 Dec 2014
Version published
16 Sep 2023
Maintainers
2
Total deps
65
Direct deps
1
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
62 Packages, Including:
accepts@1.3.8
array-flatten@1.1.1
body-parser@1.20.2
bytes@3.1.2
call-bind@1.0.7
content-disposition@0.5.4
content-type@1.0.5
cookie-signature@1.0.6
cookie@0.6.0
debug@2.6.9
define-data-property@1.1.4
depd@2.0.0
destroy@1.2.0
ee-first@1.1.1
encodeurl@1.0.2
es-define-property@1.0.0
es-errors@1.3.0
escape-html@1.0.3
etag@1.8.1
express-rate-limit@7.0.1
express@4.19.2
finalhandler@1.2.0
forwarded@0.2.0
fresh@0.5.2
function-bind@1.1.2
get-intrinsic@1.2.4
gopd@1.0.1
has-property-descriptors@1.0.2
has-proto@1.0.3
has-symbols@1.0.3
hasown@2.0.2
http-errors@2.0.0
iconv-lite@0.4.24
ipaddr.js@1.9.1
media-typer@0.3.0
merge-descriptors@1.0.1
methods@1.1.2
mime-db@1.52.0
mime-types@2.1.35
mime@1.6.0
ms@2.0.0
ms@2.1.3
negotiator@0.6.3
object-inspect@1.13.1
on-finished@2.4.1
parseurl@1.3.3
path-to-regexp@0.1.7
proxy-addr@2.0.7
range-parser@1.2.1
raw-body@2.5.2

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
inherits@2.0.4
setprototypeof@1.2.0

BSD 3-Clause "New" or "Revised" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
use-trademark
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
qs@6.11.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of express-rate-limit 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
express4.19.2209.73 kBMIT
prod peer

Visualizations

Frequently Asked Questions

What does express-rate-limit do?

Express-rate-limit is a basic rate-limiting middleware for Express. This tool is typically used to limit repeated requests to public APIs and/or endpoints such as password reset. Its function is vital in abuse prevention by moderating the frequency of requests by individual clients within a specified timeframe.

How do you use express-rate-limit?

Use of the express-rate-limit package involves installing the package, importing it into your project and applying the rate-limiting middleware to the desired requests. Below are some examples of how to use it in your JavaScript code:

First, install the package using npm or yarn -

npm install express-rate-limit
// or
yarn add express-rate-limit

Next, import it to your project:

For a CommonJS project:

const { rateLimit } = require('express-rate-limit');

For a ESM project:

import { rateLimit } from 'express-rate-limit'

Finally, apply the rate-limiting middleware to the desired routes:

Applying to all requests in an API-only server:

import { rateLimit } from 'express-rate-limit'

const limiter = rateLimit({
	windowMs: 15 * 60 * 1000, // 15 minutes
	max: 100 // limit each IP to 100 requests per window
})

//  apply to all requests
app.use(limiter)

Applying to specific requests:

import { rateLimit } from 'express-rate-limit'

const apiLimiter = rateLimit({
	windowMs: 15 * 60 * 1000,
	max: 100
})

// only apply to requests that begin with /api/
app.use('/api/', apiLimiter)

Where are the express-rate-limit docs?

The documentation for express-rate-limit can be found on its GitHub repository at https://github.com/express-rate-limit/express-rate-limit. The readme file on the repository provides extensive information on how to install, use and configure the package. It also includes links to further resources for detailed understanding and application of the package.