{"_id":"@croco/metering-upstash","_rev":"2-9c52cd53dcc2a08ad3c06a51ce6b2af0","name":"@croco/metering-upstash","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"@croco/metering-upstash","version":"0.0.1","_id":"@croco/metering-upstash@0.0.1","maintainers":[{"name":"kang-heewon","email":"heewon.dev@gmail.com"},{"name":"ddark","email":"ddark.kr@gmail.com"}],"dist":{"shasum":"0ae500bfe512b4439991f06a3acb9d134f966228","tarball":"https://registry.npmjs.org/@croco/metering-upstash/-/metering-upstash-0.0.1.tgz","fileCount":6,"integrity":"sha512-EUOGbP+ClnU9V8h6InMQ/OxgjjvhWMYZtZScHu+0Ef5pi6vI5QIY/0Klbayo0uOZJJP3aEl8RegX/BcYK95Qig==","signatures":[{"sig":"MEUCIQC8aIyzGCPrsIsjCJ6HGodYChR4I4RVP1NKiU+3vJt5xAIgd9qjM4isCMZyY9ufNr0ALYIqtGfkY2Ns9nhbtcKfDT8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5890},"main":"./dist/index.js","type":"commonjs","_from":"file:croco-metering-upstash-0.0.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"lint":"oxlint .","test":"vitest run","build":"tsup src/index.ts --format esm,cjs --minify --clean --dts","typecheck":"tsc --noEmit"},"_npmUser":{"name":"kang-heewon","email":"heewon.dev@gmail.com"},"_resolved":"/tmp/b35ceb53076558c0034968aff4379aa6/croco-metering-upstash-0.0.1.tgz","_integrity":"sha512-EUOGbP+ClnU9V8h6InMQ/OxgjjvhWMYZtZScHu+0Ef5pi6vI5QIY/0Klbayo0uOZJJP3aEl8RegX/BcYK95Qig==","_npmVersion":"10.9.7","description":"`@upstash/redis`를 `@croco/metering-core`에서 요구하는 RedisClient 인터페이스로 연결하는 어댑터입니다.","directories":{},"_nodeVersion":"22.22.2","dependencies":{"@upstash/redis":"^1.34.0","@croco/metering-core":"0.0.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vitest":"4.0.16","typescript":"^5.7.0"},"_npmOperationalInternal":{"tmp":"tmp/metering-upstash_0.0.1_1778834269864_0.504986766136341","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@croco/metering-upstash","version":"0.0.2","type":"commonjs","main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js","types":"./dist/index.d.ts"}},"publishConfig":{"access":"public"},"dependencies":{"@upstash/redis":"^1.34.0","@croco/metering-core":"0.0.2"},"devDependencies":{"tsup":"^8.0.0","typescript":"^5.7.0","vitest":"4.0.16"},"scripts":{"build":"tsup src/index.ts --format esm,cjs --minify --clean --dts","test":"vitest run","typecheck":"tsc --noEmit","lint":"oxlint ."},"_id":"@croco/metering-upstash@0.0.2","description":"`@upstash/redis`를 `@croco/metering-core`에서 요구하는 RedisClient 인터페이스로 연결하는 어댑터입니다.","_integrity":"sha512-zerjPcL5demfSkgpqfhBayoZ49OcA9IUzGQarGPHeaQcEBRLde+ofIpbxHpmtLqDumGcA4qI/iaD1BCwJzG83A==","_resolved":"/private/var/folders/zp/px4pj6gs20q8c38hgmbym1080000gn/T/7bfcd4bffc820e671a64378cd68e803a/croco-metering-upstash-0.0.2.tgz","_from":"file:croco-metering-upstash-0.0.2.tgz","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-zerjPcL5demfSkgpqfhBayoZ49OcA9IUzGQarGPHeaQcEBRLde+ofIpbxHpmtLqDumGcA4qI/iaD1BCwJzG83A==","shasum":"2d07fc516d0d4be27d9679fac98d97dd9a24c421","tarball":"https://registry.npmjs.org/@croco/metering-upstash/-/metering-upstash-0.0.2.tgz","fileCount":6,"unpackedSize":5890,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCI62jNbj6PLU6BTpxR77ikNUc3JI5/vXlEGY1g7s7idgIhAN1MzIzhMStZA9JYI2ESUAJTmjpb5EBH+nR23D4AgV5b"}]},"_npmUser":{"name":"kang-heewon","email":"heewon.dev@gmail.com"},"directories":{},"maintainers":[{"name":"kang-heewon","email":"heewon.dev@gmail.com"},{"name":"ddark","email":"ddark.kr@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/metering-upstash_0.0.2_1780294644142_0.6611803971823258"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-15T08:37:49.806Z","modified":"2026-06-01T06:17:24.412Z","0.0.1":"2026-05-15T08:37:49.995Z","0.0.2":"2026-06-01T06:17:24.277Z"},"description":"`@upstash/redis`를 `@croco/metering-core`에서 요구하는 RedisClient 인터페이스로 연결하는 어댑터입니다.","maintainers":[{"name":"kang-heewon","email":"heewon.dev@gmail.com"},{"name":"ddark","email":"ddark.kr@gmail.com"}],"readme":"# @croco/metering-upstash\n\n`@upstash/redis`를 `@croco/metering-core`에서 요구하는 RedisClient 인터페이스로 연결하는 어댑터입니다.\n\n## 설치\n\n```bash\npnpm add @croco/metering-upstash @upstash/redis\n```\n\n## 사용법\n\n```typescript\nimport { Redis } from \"@upstash/redis\";\nimport { createUpstashRedisClient } from \"@croco/metering-upstash\";\nimport { IdempotencyManager, RedisUsageStorage } from \"@croco/metering-core\";\n\nconst redis = new Redis({\n  url: process.env.UPSTASH_REDIS_REST_URL!,\n  token: process.env.UPSTASH_REDIS_REST_TOKEN!,\n});\n\nconst client = createUpstashRedisClient(redis);\nconst usageStorage = new RedisUsageStorage(client);\nconst idempotency = new IdempotencyManager(client);\n```\n\n## API 레퍼런스\n\n| API                          | 설명                                                                          |\n| ---------------------------- | ----------------------------------------------------------------------------- |\n| `UpstashRedisClient`         | `zadd`, `zrangebyscore`, `set`, `eval`을 metering-core 시그니처로 제공합니다. |\n| `createUpstashRedisClient()` | Upstash Redis 인스턴스를 빠르게 어댑터로 감쌉니다.                            |\n\n## 동작 메모\n\n- 서버리스 환경에서 쓰기 쉬운 HTTP 기반 Upstash SDK를 그대로 사용합니다.\n- 반환값이 없는 `zadd`는 0으로 정규화합니다.\n","readmeFilename":"README.md"}