# @ioredis/commands

> Redis commands

Latest version **2.0.0** (published 2026-07-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ioredis/commands
pnpm add @ioredis/commands
yarn add @ioredis/commands
bun add @ioredis/commands
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2026-07-28 |
| First published | 2022-03-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 111.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Zihua Li |
| Maintainers | ioredis-robot, dmaier-redislabs, nkaradzhov |
| Keywords | redis, commands, prefix |

## Links

- npm: https://www.npmjs.com/package/@ioredis/commands
- Repository: https://github.com/ioredis/commands
- Issues: https://github.com/ioredis/commands/issues
- npm.io page: https://npm.io/package/@ioredis/commands

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2026-07-28
- 1.11.0 — 2026-07-15
- 1.10.0 — 2026-05-22
- 1.9.0 — 2026-05-20
- 1.8.0 — 2026-05-11
- 1.7.0 — 2026-04-17
- 1.6.0 — 2026-04-07
- 1.5.1 — 2026-02-26
- 1.5.0 — 2025-11-03
- 1.4.0 — 2025-09-15
- 1.3.1 — 2025-08-29
- 1.3.0 — 2025-07-28
- 1.2.0 — 2022-06-25
- 1.1.1 — 2022-03-26
- 1.1.0 — 2022-03-06
- … 6 more at https://npm.io/package/@ioredis/commands/versions

## README

# Redis Commands

This module exports all the commands that Redis supports.

## Install

```shell
$ npm install @ioredis/commands
```

## Usage

```js
const commands = require('@ioredis/commands');
```

`.list` is an array contains all the lowercased commands:

```js
commands.list.forEach((command) => {
  console.log(command);
});
```

`.exists()` is used to check if the command exists:

```js
commands.exists('set') // true
commands.exists('other-command') // false
```

`.hasFlag()` is used to check if the command has the flag:

```js
commands.hasFlag('set', 'readonly') // false
```

`.getKeyIndexes()` is used to get the indexes of keys in the command arguments:

```js
commands.getKeyIndexes('set', ['key', 'value']) // [0]
commands.getKeyIndexes('mget', ['key1', 'key2']) // [0, 1]
```

---
_Source: https://npm.io/package/@ioredis/commands · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
