upstash-ratelimit-ts
Lightweight guidance for using the Redis Rate Limit TypeScript SDK, including setup steps, basic usage, and pointers to advanced algorithm, features, pricing, and traffic‑protection docs.
适合你,如果需要在 TypeScript 项目中使用 Redis 实现速率限制
/ 通过 npx 安装 校验哈希
npx oh-my-skill add upstash/ratelimit-js/upstash-ratelimit-ts/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- upstash/ratelimit-js/upstash-ratelimit-ts/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify upstash/ratelimit-js/upstash-ratelimit-ts安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
2042GitHub stars
~259最小装载
~3.4K含声明引用
~3.4K文本包总量
索引托管
怎么用
商店整理自技能原文 · 版本 5b5448a · 表述以原文为准它做什么
装上后,Claude 能帮你生成使用 Upstash Redis 速率限制 TypeScript SDK 的代码,包括安装、创建限流器、检查请求是否被限流等。
什么时候触发
当你询问如何用 TypeScript 实现 Redis 速率限制,或要求生成相关代码时触发。
装好后可以这样说
Claude 会生成对应的 TypeScript 代码。
Claude 会解释 limit 方法的返回值。
技能原文 SKILL.md
Rate Limit TS SDK
Quick Start
- Install the SDK and connect to Redis.
- Create a rate limiter and apply it to incoming operations.
Example:
import { Ratelimit } from "@upstash/ratelimit";
import { Redis } from "@upstash/redis";
const redis = new Redis({ url: "<url>", token: "<token>" });
const limiter = new Ratelimit({ redis, limiter: Ratelimit.slidingWindow(5, "10s") });
const { success } = await limiter.limit("user-id");
if (!success) {
// throttled
}
Other Skill Files
- algorithms.md: Describes all available rate‑limiting algorithms and how they behave.
- pricing-cost.md: Explains pricing, Redis cost implications, and operational considerations.
- features.md: Lists SDK features such as prefixes, custom keys, and behavioral options.
- methods-getting-started.md: Full method reference for the SDK's API and getting started guide.
- traffic-protection.md: Guidance on applying rate limiting for traffic shaping, abuse prevention, and protection patterns.
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →
评论
登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。
…