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

@jfungus/ratelimit-unstorage

v0.0.2

Published

unstorage adapter for @jfungus/ratelimit - supports Redis, Cloudflare KV, Vercel KV, and more

Readme

@jfungus/ratelimit-unstorage

npm version npm downloads CI

unstorage adapter for @jfungus/ratelimit. Enables distributed rate limiting with Redis, Cloudflare KV, Vercel KV, Upstash, and more.

Installation

npm install @jfungus/ratelimit-unstorage unstorage

Usage

import { createStorage } from "unstorage";
import { createUnstorageStore } from "@jfungus/ratelimit-unstorage";
import { rateLimiter } from "@jfungus/ratelimit-hono"; // or express, h3

// Create unstorage instance with your preferred driver
const storage = createStorage({
  driver: /* your driver */,
});

// Create the store
const store = createUnstorageStore({ storage });

// Use with any middleware
app.use(
  rateLimiter({
    limit: 100,
    windowMs: 60 * 1000, // 1 minute
    store,
  })
);

Storage Drivers

Redis

import { createStorage } from "unstorage";
import redisDriver from "unstorage/drivers/redis";
import { createUnstorageStore } from "@jfungus/ratelimit-unstorage";

const storage = createStorage({
  driver: redisDriver({
    url: "redis://localhost:6379",
    // or with options
    host: "localhost",
    port: 6379,
    password: "your-password",
    db: 0,
  }),
});

const store = createUnstorageStore({ storage });

Upstash Redis

import { createStorage } from "unstorage";
import upstashDriver from "unstorage/drivers/upstash";
import { createUnstorageStore } from "@jfungus/ratelimit-unstorage";

const storage = createStorage({
  driver: upstashDriver({
    url: "https://your-upstash-url.upstash.io",
    token: "your-upstash-token",
  }),
});

const store = createUnstorageStore({ storage });

Cloudflare KV

import { createStorage } from "unstorage";
import cloudflareKVDriver from "unstorage/drivers/cloudflare-kv-binding";
import { createUnstorageStore } from "@jfungus/ratelimit-unstorage";

const storage = createStorage({
  driver: cloudflareKVDriver({
    binding: "RATELIMIT_KV",
  }),
});

const store = createUnstorageStore({ storage });

Vercel KV

import { createStorage } from "unstorage";
import vercelKVDriver from "unstorage/drivers/vercel-kv";
import { createUnstorageStore } from "@jfungus/ratelimit-unstorage";

const storage = createStorage({
  driver: vercelKVDriver({
    // Uses VERCEL_KV_* env vars automatically
  }),
});

const store = createUnstorageStore({ storage });

Memory (for development)

import { createStorage } from "unstorage";
import { createUnstorageStore } from "@jfungus/ratelimit-unstorage";

const storage = createStorage(); // memory driver is default

const store = createUnstorageStore({ storage });

Options

const store = createUnstorageStore({
  // Required: unstorage instance
  storage,

  // Optional: key prefix (default: "ratelimit")
  prefix: "ratelimit",
});

Supported Drivers

Any unstorage driver that supports getItem, setItem, and basic operations:

  • Redis
  • Upstash
  • Cloudflare KV
  • Vercel KV
  • Deno KV
  • Azure Storage
  • MongoDB
  • Planetscale
  • And many more...

Documentation

Full documentation

License

MIT