Registry / devops / rate-limit-sqlite

rate-limit-sqlite

JSON →
library0.0.2jsnpmunverified

A SQLite store for the express-rate-limit middleware, enabling persistent rate limiting across server restarts. Currently at version 0.0.2 (stable, early release). Requires express-rate-limit >= 6 and Node.js >= 22. Pure ESM package. Unlike in-memory stores, this store uses SQLite on disk or in-memory, offering persistence and shared state between processes. Suitable for single-server deployments where Redis is overkill.

npm install rate-limit-sqlite
INSTALL
IMPORT
SIG · RATE-LIMIT-SQLITE
R
rate-limit-sqlite
devopsjavascriptv0.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SqliteStore
import { SqliteStore } from 'rate-limit-sqlite'
const SqliteStore = require('rate-limit-sqlite')
ESM-only package; cannot use require()
SqliteStore (default import)
import { SqliteStore } from 'rate-limit-sqlite'
import SqliteStore from 'rate-limit-sqlite'
Only named export available; no default export
Types (if needed)
import type { SqliteStore } from 'rate-limit-sqlite'
TypeScript uses same named export; type-only import when value not needed at runtime

Creates a rate limiter with a SQLite store using an in-memory database.

import { rateLimit } from 'express-rate-limit'; import { SqliteStore } from 'rate-limit-sqlite'; const limiter = rateLimit({ windowMs: 15 * 60 * 1000, max: 100, standardHeaders: true, legacyHeaders: false, store: new SqliteStore({ location: ':memory:', prefix: 'rl', }), }); // Apply to Express app app.use(limiter);
Debug
Known issues
breakingNode.js 22 or above required. Older versions will fail to load the ESM module.
fix
Upgrade Node.js to version 22 or later.
affects: <22
gotchaPackage is pure ESM. Cannot use CommonJS require().
fix
Use type: module in package.json or use .mjs extension.
affects: all
deprecatedNo deprecated features in this early version.
fix
N/A
affects: none
gotchaThe store only works with express-rate-limit >= 6. Older versions will cause runtime errors.
fix
Install express-rate-limit@6 or later.
affects: >=0.0.0
gotchaThe prefix option defaults to 'def', which may conflict with other usage in the same database.
fix
Always set a unique prefix if sharing database across applications.
affects: all
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module ... not supported.
Using require() on this ESM-only package.
fix
Use import syntax and ensure project is ESM (type: module or .mjs).
SQLITE_ERROR: no such table: ...
Table not created automatically or missing migration.
fix
Ensure the database location exists; the store creates tables on instantiation.
Cannot find module 'express-rate-limit'
Missing peer dependency.
fix
npm install express-rate-limit@6
TypeError: SqliteStore is not a constructor
Using a default import instead of named import.
fix
Use import { SqliteStore } from 'rate-limit-sqlite'
Upgrade
Version history
0.0.2latest on npm
Audit
Dependencies
express-rate-limitrequiredpeer dependency; the store is built to be used with express-rate-limit >= 6
Agent activity
4 hits · last 30 days
node
4
Resources
rate-limit-sqlite — npm install rate-limit-sqlite · libregistry