Home
Installing Upstash.js
npm i upstash.jsyarn add upstash.jsInitializing Upstash.js
import Upstash from "upstash.js"
const upstash = new Upstash()const upstash = new Upstash({
url: "Your Upstash URL",
token: "Your Upstash REST Token"
})General Usage
import Upstash from "upstash.js"
const upstash = new Upstash();
//here we destructure the return type into two variables result and error
const [result, error] = await upstash.get("keyname")
//we can check if there is an error
if (error) {
//handle error
}
//now we know that there was no error, we can work with the result
console.log(result)Last updated