# redis-commands

> Redis commands

Latest version **1.7.0** (published 2021-02-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install redis-commands
pnpm add redis-commands
yarn add redis-commands
bun add redis-commands
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.7.0 |
| Published | 2021-02-06 |
| First published | 2013-04-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 43.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 83 |
| Author | luin |
| Maintainers | luin, salakar, bridgear |
| Keywords | redis, commands, prefix |

## Links

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

- 1.7.0 (latest) — 2021-02-06
- 1.6.0 — 2020-07-25
- 1.5.0 — 2019-05-10
- 1.4.0 — 2018-10-08
- 1.3.5 — 2018-02-28
- 1.3.4 — 2018-02-26
- 1.3.3 — 2018-02-24
- 1.3.2 — 2018-02-24
- 1.3.1 — 2017-01-25
- 1.3.0 — 2016-10-20
- 1.2.0 — 2016-04-21
- 1.1.0 — 2016-02-09
- 1.0.2 — 2016-01-03
- 1.0.1 — 2015-11-23
- 1.0.0 — 2015-10-31
- … 3 more at https://npm.io/package/redis-commands/versions

## README

# Redis Commands

[![Build Status](https://travis-ci.org/NodeRedis/redis-commands.png?branch=master)](https://travis-ci.org/NodeRedis/redis-commands)
[![Code Climate](https://codeclimate.com/github/NodeRedis/redis-commands/badges/gpa.svg)](https://codeclimate.com/github/NodeRedis/redis-commands)
[![Test Coverage](https://codeclimate.com/github/NodeRedis/redis-commands/badges/coverage.svg)](https://codeclimate.com/github/NodeRedis/redis-commands/coverage)

This module exports all the commands that Redis supports.

## Install

```shell
$ npm install redis-commands
```

## Usage

```javascript
var commands = require('redis-commands');
```

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

```javascript
commands.list.forEach(function (command) {
  console.log(command);
});
```

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

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

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

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

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

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

## Acknowledgment

Thank [@Yuan Chuan](https://github.com/yuanchuan) for the package name. The original redis-commands is renamed to [@yuanchuan/redis-commands](https://www.npmjs.com/package/@yuanchuan/redis-commands).

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