Socket
Socket
Sign inDemoInstall

redis-commands

Package Overview
Dependencies
0
Maintainers
3
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    redis-commands

Redis commands


Version published
Weekly downloads
2.1M
decreased by-18.27%
Maintainers
3
Install size
44.2 kB
Created
Weekly downloads
 

Changelog

Source

v.1.7.0 - 6 Feb, 2021

Features

  • Updated commands list to Redis 6.2

Readme

Source

Redis Commands

Build Status Code Climate Test Coverage

This module exports all the commands that Redis supports.

Install

$ npm install redis-commands

Usage

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

.list is an array contains all the lowercased commands:

commands.list.forEach(function (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]

Acknowledgment

Thank @Yuan Chuan for the package name. The original redis-commands is renamed to @yuanchuan/redis-commands.

Keywords

FAQs

Last updated on 06 Feb 2021

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