Catalog npm
Back to packageRELEASE DETAILS

0.0.0

npm

4bytes-redis

An HTTP/REST based Redis client

databaseedgeredisserverlessupstash
Published19 Mar 2024
Direct dependencies6
Transitive dependenciesNot calculated

README

Current package documentation

Upstash Redis

@upstash/redis is an HTTP/REST based Redis client for typescript, built on top of Upstash REST API.

Tests npm (scoped) npm bundle size

[!NOTE]
This project is in GA Stage.

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.

It is the only connectionless (HTTP based) Redis client and designed for:

  • Serverless functions (AWS Lambda ...)
  • Cloudflare Workers (see the example)
  • Fastly Compute@Edge (see the example)
  • Next.js, Jamstack ...
  • Client side web/mobile applications
  • WebAssembly
  • and other environments where HTTP is preferred over TCP.

See the list of APIs supported.

Quick Start

Install

Node.js

npm install @upstash/redis

Deno

import { Redis } from "https://esm.sh/@upstash/redis";

Create database

Create a new redis database on upstash

Basic Usage:

import { Redis } from "@upstash/redis"

const redis = new Redis({
  url: <UPSTASH_REDIS_REST_URL>,
  token: <UPSTASH_REDIS_REST_TOKEN>,
})

// string
await redis.set('key', 'value');
let data = await redis.get('key');
console.log(data)

await redis.set('key3', 'value3', {ex: 1});

// sorted set
await redis.zadd('scores', { score: 1, member: 'team1' })
data = await redis.zrange('scores', 0, 100 )
console.log(data)

// list
await redis.lpush('elements', 'magnesium')
data = await redis.lrange('elements', 0, 100 )
console.log(data)

// hash
await redis.hset('people', {name: 'joe'})
data = await redis.hget('people', 'name' )
console.log(data)

// sets
await redis.sadd('animals', 'cat')
data  = await redis.spop('animals', 1)
console.log(data)

Troubleshooting

We have a dedicated page for common problems. If you can't find a solution, please open an issue.

Docs

See the documentation for details.

Contributing

Install Bun

Database

Create a new redis database on upstash and copy the url and token

Running tests

bun run test

Building

bun run build

Telemetry

This library sends anonymous telemetry data to help us improve your experience. We collect the following:

  • SDK version
  • Platform (Deno, Cloudflare, Vercel)
  • Runtime version (node@18.x)

You can opt out by setting the UPSTASH_DISABLE_TELEMETRY environment variable to any truthy value.

UPSTASH_DISABLE_TELEMETRY=1

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 6

Native requirements
6 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
crypto-js
Environment
{
  "local_name": "crypto-js",
  "alias": false,
  "peer_metadata": null
}
^4.2.0runtime
@types/crypto-js
Environment
{
  "local_name": "@types/crypto-js",
  "alias": false,
  "peer_metadata": null
}
^4.1.3development
bun-types
Environment
{
  "local_name": "bun-types",
  "alias": false,
  "peer_metadata": null
}
^1.0.6development
tsup
Environment
{
  "local_name": "tsup",
  "alias": false,
  "peer_metadata": null
}
^7.2.0development
@biomejs/biome
Environment
{
  "local_name": "@biomejs/biome",
  "alias": false,
  "peer_metadata": null
}
latestdevelopment
husky
Environment
{
  "local_name": "husky",
  "alias": false,
  "peer_metadata": null
}
^8.0.3development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "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="
    }
  ]
}

Repository

PENDING
upstash/upstash-redis

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 20:06 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:47c458fcbcc36e8504e7bc4effa75809ef7c2786a077031e55caa1e8d799f2ee

Other collected versions

View all collected versions →