# @iovalkey/commands

> Valkey commands

Latest version **0.1.0** (published 2025-01-23) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2025-01-23 |
| First published | 2025-01-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 54.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Zihua Li |
| Maintainers | matteo.collina |
| Keywords | redis, commands, prefix |

## Links

- npm: https://www.npmjs.com/package/@iovalkey/commands
- Repository: https://github.com/iovalkey/commands
- Issues: https://github.com/iovalkey/commands/issues
- npm.io page: https://npm.io/package/@iovalkey/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

- 0.1.0 (latest) — 2025-01-23

## README

# Valkey Commands

This module exports all the commands that Valkey supports.

This module was forked from [`@ioredis/commands`](https://github.com/ioredis/commands) at commit 4321d5d40473c48fadf49fd99662032eac9b855b

## Install

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

## Usage

```js
const commands = require('@iovalkey/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]
```

## License

MIT

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