कंटेंट पर जाएँ
TakoAPI
स्किल्स पर वापस

rate-limit-pro

raghulpasupathi द्वारा

Coding Agents & IDEs
419clawskills.sh द्वारा बताए गए डाउनलोड
0व्यूज़
0 लाइकइस स्किल को लाइक करने के लिए साइन इन करें
—अभी तक कोई रेटिंग नहीं
आपकी रेटिंग

संक्षिप्त

Advanced rate limiting with tiered controls and quota management.

विवरण

यह स्किल क्या करती है

Rate Limit Pro is a JavaScript class that enforces per-user request quotas using sliding time windows and configurable tiers. It tracks request timestamps in memory and returns remaining quota, reset timing, and denial reasons on each check.

It handles sliding window tracking and multi-tier quota management in a single in-memory class with no external dependencies like Redis.

इसे कब इस्तेमाल करें

  • Enforcing free-tier request caps in a multi-tenant API
  • Blocking abusive users before they exhaust shared resources
  • Differentiating access between free and paid plan users
  • Preventing burst traffic from a single user ID
  • Testing rate limit logic in a local dev environment

उदाहरण वर्कफ़्लो

इनपुट

User asks: check if user123 can make another request on the free tier

एजेंट
  1. 1

    Instantiate RateLimiter with free tier set to 10 requests per 60 seconds

  2. 2

    Call checkLimit('user123', 'free') to evaluate the current request count

  3. 3

    Filter out timestamps older than the 60-second window

  4. 4

    Return allowed status with remaining count, or denial reason with resetIn seconds

आउटपुट

{ allowed: true, limit: 10, remaining: 7, resetIn: 60 } or { allowed: false, reason: 'rate_limit_exceeded', resetIn: 23 }

इंस्टॉलेशन

clawhub install raghulpasupathi/rate-limit-pro

CLI कमांड चलाएँ, या प्रॉम्प्ट को Claude Code, Cursor, Codex या जो भी कोडिंग एजेंट आप इस्तेमाल करते हैं उसमें पेस्ट करें।

लिंक