Basic Redis set and get in Node.js.
Code Playground
JavaScript (V8)
Loading...
Console Output
// Output will appear here...
// For React: ReactDOM.createRoot(rootElement).render(<App />);
// For React: ReactDOM.createRoot(rootElement).render(<App />);
Recommended Answer
js
const redis = require('redis');
const client = redis.createClient();
await client.connect();
await client.set('key', 'value');
const value = await client.get('key');
console.log(value);