본문으로 건너뛰기
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 등 사용하는 코딩 에이전트에 붙여넣으세요.

링크