Socket
Socket
Sign inDemoInstall

@ioredis/commands

Package Overview
Dependencies
0
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ioredis/commands

Redis commands


Version published
Weekly downloads
2.8M
decreased by-15.33%
Maintainers
2
Install size
54.3 kB
Created
Weekly downloads
 

Readme

Source

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]

Keywords

FAQs

Last updated on 25 Jun 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc