Ask coding questions

← Back to all posts
how to use repl.it db in node?
exp1109 (1)

i want some repl.it db example in node.
but there's no example.

The code I'm currently writing is this.

const Database = require('@replit/database');
const db = new Database();
var valuee;
var val;
db.set("key", "value", "value1").then(() => {
});
db.get("key").then(value => {
valuee = value;
});
console.log(valuee);
console.log(val);
This code sends: undefined

Comments
hotnewtop
r3b0rn (28)

on the side there is this button for replit db!