Registry / database / volos-quota-redis

volos-quota-redis

JSON →
library0.11.8jsnpmunverified

Redis-backed implementation of quota enforcement for the Volos API management system. Version 0.11.8 provides quota tracking with configurable time units (minute, hour, day, week, month), intervals, and start times. Uses the 'volos-quota-common' programming interface. Supports concurrency via Redis atomic operations. Note: This package is part of the deprecated Apigee Volos ecosystem; not actively maintained.

npm install volos-quota-redis
INSTALL
IMPORT
SIG · VOLOS-QUOTA-REDIS
V
volos-quota-redis
databasejavascriptv0.11.8
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.

default
const quota = require('volos-quota-redis');
import quota from 'volos-quota-redis';
Package uses CommonJS. No ESM support.
create
const quotaModule = require('volos-quota-redis'); const quota = quotaModule.create({...});
const { create } = require('volos-quota-redis');
create is a method on the default export, not a named export.
apply
quota.apply({ identifier: 'Foo', weight: 1 }, callback);
quota.apply({ identifier: 'Foo', weight: 1 }).then(...);
Callbacks only. No Promise support.

Initializes a daily quota of 10 requests per user using Redis and applies a single request.

const quotaModule = require('volos-quota-redis'); const quota = quotaModule.create({ timeUnit: 'day', interval: 1, allow: 10, host: process.env.REDIS_HOST || '127.0.0.1', port: parseInt(process.env.REDIS_PORT || '6379'), db: 0 }); quota.apply({ identifier: 'test-user', weight: 1 }, (err, result) => { if (err) { console.error(err); return; } console.log(`Quota allowed: ${result.isAllowed}`); });
Debug
Known issues
deprecatedThis package is part of the deprecated Apigee Volos project. No active development.
fix
Migrate to a supported quota management solution such as express-rate-limit or ratelimiter.
affects: *
breakingMissing 'redis' peer dependency causes runtime error: Cannot find module 'redis'
fix
Run `npm install redis` as a runtime dependency.
affects: *
gotchaOptions 'startTime' is not allowed for 'month' timeUnit; initializes without startTime silently.
fix
Do not include 'startTime' when timeUnit is 'month'.
affects: *
gotchaCallbacks only; using promises or async/await will not work.
fix
Wrap in a Promise manually if needed.
affects: *
deprecatedNode.js version compatibility unknown for modern Node releases (>=14).
fix
Test with your Node version or consider replacement.
affects: >=14
Errors
Common errors & fixes
Cannot find module 'redis'
Missing peer dependency 'redis'
fix
npm install redis
quotaModule.create is not a function
Attempting to destructure create as a named export instead of using default export.
fix
const quotaModule = require('volos-quota-redis'); const quota = quotaModule.create({...});
TypeError: quota.apply is not a function
Using the module itself instead of the created quota instance
fix
const quota = quotaModule.create({...}); quota.apply(...);
Upgrade
Version history
0.11.8latest on npm
Audit
Dependencies
redisrequiredRedis client for database operations
volos-quota-commonrequiredProvides common quota programming interface
Agent activity
23 hits · last 30 days
node
20
Meta
1
OpenAI (training)
1
Resources
volos-quota-redis — npm install volos-quota-redis · libregistry