# Redis in a Node App — Redis Fundamentals: Caching, Data Structures and Persistence

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

> Connect to Redis from Node.js with the official redis package and cache values using async commands.

## 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'
```
