npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@radioac7iv/rate-limiter

v2.1.2

Published

Rate limiting middleware library

Downloads

43

Readme

Rate Limiter

A highly configurable rate-limiting middleware for Express.js applications.

Overview

The Rate Limiter is an open-source NPM package designed for managing request rates in Express.js applications. It helps prevent abuse and ensures fair usage of server resources through customizable rate-limiting logic.

Features

  • Highly configurable and flexible
  • Supports in-memory and custom stores
  • Automatic cleanup of expired rate data
  • Customizable headers and response messages
  • Optional logging for requests
  • Seamless integration with Express.js

Installation

npm i @radioac7iv/rate-limiter

Usage

Basic Example

import express from "express";
import { expressRateLimiter } from "@radioac7iv/rate-limiter";

const app = express();

const rateLimit = expressRateLimiter({
  key: (req, res) => req.ip as string,
  limitOptions: () => {
    return { max: 5, window: 10 };
  },
  headersType: "draft-7",
  logs: {
    directory: "./logs",
  },
});

app.use(rateLimit);

app.get("/", (request, response) => {
  response.status(200).send({ message: "Hello!" });
});

app.listen(3000, () => {
  console.log("Server started at PORT: 3000");
});

Configuration

The rate limiter can be configured using the following options:

| Option | Type | Description | Default | | ------------------ | --------------------- | ------------------------------------------------------------------------------------------- | ------------------- | | key | function | Unique key to identify each client (e.g., IP address or an API Key). | Client's IP address | | skip | string[] | Keys to skip from rate-limiting. | [] | | skipFailedRequests | boolean | Whether to exclude failed requests from rate limits. | false | | message | string | Custom message when the rate limit is exceeded. | Rate limit exceeded | | statusCode | number | HTTP status code to send when the rate limit is exceeded. | 429 | | headersType | HeadersType | Choose between "legacy", "draft-6", "draft-7" or "draft-8" | legacy | | logs | object | Configuration for logging requests | undefined | | limitOptions | object | Function returning Object defining max (maximum requests) and window (time in seconds). | None (required) | | storeType | StoreType | Choose between "memory", "redis" or "mongodb" | memory | | externalStore | RedisClientType | Db | External store instance for storing rate-limiting data. | undefined |