Installation

Prerequisites

  • Node.js ≥ 18
  • Redis ≥ 6

Install the package

Install redis-graph-cache using your preferred package manager:

npm

npm install redis-graph-cache ioredis

yarn

yarn add redis-graph-cache ioredis

pnpm

pnpm add redis-graph-cache ioredis

bun

bun add redis-graph-cache ioredis

Important: ioredis is a peer dependency

ioredis is a peer dependency and is installed automatically. If you already use ioredis in your app, your existing version is reused (must be ^5.0.0).

TypeScript types

The package includes built-in TypeScript types. No additional type installation is required.

import { RedisGraphCache } from 'redis-graph-cache';

const cache = new RedisGraphCache(schema, {
  redis: { host: 'localhost', port: 6379 },
  // Full TypeScript support with autocomplete
});

Verify installation

After installation, you can verify that everything is working correctly by running a simple test:

import { RedisGraphCache } from 'redis-graph-cache';

const schema = {
  test: {
    type: 'entity' as const,
    id: 'id',
    key: (id: string) => `test:${id}`,
    fields: { name: { type: 'string' as const } },
  },
};

const cache = new RedisGraphCache(schema, {
  redis: { host: 'localhost', port: 6379 },
});

console.log('Redis Graph Cache installed successfully!');
await cache.disconnect();

Development dependencies

If you're developing with TypeScript, you may want to install type definitions for ioredis:

npm install --save-dev @types/ioredis

Installation complete!

You're ready to start using redis-graph-cache in your project.

Next steps

Now that you have redis-graph-cache installed, you can: