{"_id":"4bytes-redis","name":"4bytes-redis","dist-tags":{"latest":"0.0.0"},"versions":{"0.0.0":{"name":"4bytes-redis","version":"0.0.0","main":"./nodejs.js","module":"./nodejs.mjs","exports":{".":{"import":"./nodejs.mjs","require":"./nodejs.js"},"./node":{"import":"./nodejs.mjs","require":"./nodejs.js"},"./node.js":"./node.js","./node.mjs":"./node.mjs","./cloudflare":{"import":"./cloudflare.mjs","require":"./cloudflare.js"},"./cloudflare.js":"./cloudflare.js","./cloudflare.mjs":"./cloudflare.mjs","./fastly":{"import":"./fastly.mjs","require":"./fastly.js"},"./fastly.js":"./fastly.js","./fastly.mjs":"./fastly.mjs"},"types":"./nodejs.d.ts","description":"An HTTP/REST based Redis client","repository":{"type":"git","url":"git+https://github.com/upstash/upstash-redis.git"},"keywords":["redis","database","serverless","edge","upstash"],"scripts":{"build":"tsup && cp README.md ./dist/ && cp package.json ./dist/ && cp LICENSE ./dist/","test":"bun test pkg --coverage","fmt":"bunx @biomejs/biome check --apply ./pkg","prepare":"husky install"},"author":{"name":"4bytes"},"license":"MIT","bugs":{"url":"https://github.com/upstash/upstash-redis/issues"},"homepage":"https://github.com/upstash/upstash-redis#readme","typesVersions":{"*":{"nodejs":["./nodejs.d.ts"],"cloudflare":["./cloudflare.d.ts"],"fastly":["./fastly.d.ts"]}},"devDependencies":{"@types/crypto-js":"^4.1.3","bun-types":"^1.0.6","tsup":"^7.2.0","@biomejs/biome":"latest","husky":"^8.0.3"},"dependencies":{"crypto-js":"^4.2.0"},"_id":"4bytes-redis@0.0.0","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"integrity":"sha512-Nm2q3fU0Tf9Cg60I/OHT5mgDe/6lj4JM2bjoxAHi8RUtQaKuFsE6TQMeVJ5px7B/QaASk2qIxYXlYYSB0PO7IA==","shasum":"064848c9059005b97490b091aa53bb986dfd3141","tarball":"https://registry.npmjs.org/4bytes-redis/-/4bytes-redis-0.0.0.tgz","fileCount":18,"unpackedSize":275607,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEPPBEvwAvupPTguqazbTu6VA6DSbH2vXu5PCAA4+HahAiEA2Z1m17hqkvKgHgXV2sxsySMdqcWtHgcly179Y+9rF5s="}]},"_npmUser":{"name":"lilhuy0405","email":"luuhuyulei@gmail.com"},"directories":{},"maintainers":[{"name":"lilhuy0405","email":"luuhuyulei@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/4bytes-redis_0.0.0_1710818388947_0.784137059882857"},"_hasShrinkwrap":false}},"time":{"created":"2024-03-19T03:19:48.946Z","0.0.0":"2024-03-19T03:19:49.194Z","modified":"2024-03-19T03:19:50.230Z"},"maintainers":[{"name":"lilhuy0405","email":"luuhuyulei@gmail.com"}],"description":"An HTTP/REST based Redis client","homepage":"https://github.com/upstash/upstash-redis#readme","keywords":["redis","database","serverless","edge","upstash"],"repository":{"type":"git","url":"git+https://github.com/upstash/upstash-redis.git"},"author":{"name":"4bytes"},"bugs":{"url":"https://github.com/upstash/upstash-redis/issues"},"license":"MIT","readme":"# Upstash Redis\n\n`@upstash/redis` is an HTTP/REST based Redis client for typescript, built on top\nof [Upstash REST API](https://docs.upstash.com/features/restapi).\n\n[![Tests](https://github.com/upstash/upstash-redis/actions/workflows/tests.yaml/badge.svg)](https://github.com/upstash/upstash-redis/actions/workflows/tests.yaml)\n![npm (scoped)](https://img.shields.io/npm/v/@upstash/redis)\n![npm bundle size](https://img.shields.io/bundlephobia/minzip/@upstash/redis)\n\n> [!NOTE]  \n> **This project is in GA Stage.**\n>\n> The Upstash Professional Support fully covers this project. It receives regular updates, and bug fixes. The Upstash team is committed to maintaining and improving its functionality.\n\nIt is the only connectionless (HTTP based) Redis client and designed for:\n\n- Serverless functions (AWS Lambda ...)\n- Cloudflare Workers (see\n  [the example](https://github.com/upstash/upstash-redis/tree/main/examples/cloudflare-workers))\n- Fastly Compute@Edge (see\n  [the example](https://github.com/upstash/upstash-redis/tree/main/examples/fastly))\n- Next.js, Jamstack ...\n- Client side web/mobile applications\n- WebAssembly\n- and other environments where HTTP is preferred over TCP.\n\nSee\n[the list of APIs](https://upstash.com/docs/redis/overall/rediscompatibility)\nsupported.\n\n## Quick Start\n\n### Install\n\n#### Node.js\n\n```bash\nnpm install @upstash/redis\n```\n\n#### Deno\n\n```ts\nimport { Redis } from \"https://esm.sh/@upstash/redis\";\n```\n\n### Create database\n\nCreate a new redis database on [upstash](https://console.upstash.com/)\n\n## Basic Usage:\n\n```ts\nimport { Redis } from \"@upstash/redis\"\n\nconst redis = new Redis({\n  url: <UPSTASH_REDIS_REST_URL>,\n  token: <UPSTASH_REDIS_REST_TOKEN>,\n})\n\n// string\nawait redis.set('key', 'value');\nlet data = await redis.get('key');\nconsole.log(data)\n\nawait redis.set('key3', 'value3', {ex: 1});\n\n// sorted set\nawait redis.zadd('scores', { score: 1, member: 'team1' })\ndata = await redis.zrange('scores', 0, 100 )\nconsole.log(data)\n\n// list\nawait redis.lpush('elements', 'magnesium')\ndata = await redis.lrange('elements', 0, 100 )\nconsole.log(data)\n\n// hash\nawait redis.hset('people', {name: 'joe'})\ndata = await redis.hget('people', 'name' )\nconsole.log(data)\n\n// sets\nawait redis.sadd('animals', 'cat')\ndata  = await redis.spop('animals', 1)\nconsole.log(data)\n```\n\n## Troubleshooting\n\nWe have a\n[dedicated page](https://docs.upstash.com/redis/sdks/javascriptsdk/troubleshooting)\nfor common problems. If you can't find a solution, please\n[open an issue](https://github.com/upstash/upstash-redis/issues/new).\n\n## Docs\n\nSee [the documentation](https://docs.upstash.com/features/javascriptsdk) for\ndetails.\n\n## Contributing\n\n### [Install Bun](https://bun.sh/docs/installation)\n\n### Database\n\nCreate a new redis database on [upstash](https://console.upstash.com/) and copy\nthe url and token\n\n### Running tests\n\n```sh\nbun run test\n```\n\n### Building\n\n```sh\nbun run build\n```\n\n\n### Telemetry\n\nThis library sends anonymous telemetry data to help us improve your experience.\nWe collect the following:\n\n- SDK version\n- Platform (Deno, Cloudflare, Vercel)\n- Runtime version (node@18.x)\n\nYou can opt out by setting the `UPSTASH_DISABLE_TELEMETRY` environment variable\nto any truthy value.\n\n```sh\nUPSTASH_DISABLE_TELEMETRY=1\n```\n","readmeFilename":"README.md"}