Détail du package

@ioredis/commands

ioredis21.9mMIT1.2.0

Redis commands

redis, commands, prefix

readme

Redis Commands

This module exports all the commands that Redis supports.

Install

$ npm install @ioredis/commands

Usage

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

.list is an array contains all the lowercased commands:

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

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

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

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

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

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

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

changelog

1.2.0 (2022-06-25)

Features

  • update commands to Redis 7.0.2 (92f0539)

1.1.1 (2022-03-26)

Bug Fixes

1.1.0 (2022-03-06)

Features

  • support fcall and fcall_ro (8c5cc88)

1.0.2 (2022-03-06)

Bug Fixes

  • key positions for sort command (22ed6d2)

1.0.1 (2022-03-06)

Bug Fixes

  • generate TypeScript declarations (8969176)

1.0.0 (2022-03-06)

Features