# Redis in a Node App — Redis

Source: https://www.geekswithgeeks.com/en/redis/redis-node-client

> Talk to Redis from JavaScript with a client library.

## Install the client

The official `redis` package works well for most Node apps.

```bash
npm install redis
```

## Connect & use it

The client mirrors Redis commands as async methods, so caching a value looks almost like the CLI.

```javascript
import { createClient } from 'redis';

const client = createClient({ url: 'redis://localhost:6379' });
await client.connect();

await client.set('greeting', 'hello', { EX: 60 });
const value = await client.get('greeting');
console.log(value); // 'hello'
```
