Name: redis-commands
Owner: NodeRedis
Description: Redis commands
Created: 2015-03-25 10:37:13.0
Updated: 2018-05-23 20:41:01.0
Pushed: 2018-05-23 20:40:59.0
Size: 55
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This module exports all the commands that Redis supports.
m install redis-commands
commands = require('redis-commands');
.list
is an array contains all the lowercased commands:
ands.list.forEach(function (command) {
nsole.log(command);
.exists()
is used to check if the command exists:
ands.exists('set') // true
ands.exists('other-command') // false
.hasFlag()
is used to check if the command has the flag:
ands.hasFlag('set', 'readonly') // false
.getKeyIndexes()
is used to get the indexes of keys in the command arguments:
ands.getKeyIndexes('set', ['key', 'value']) // [0]
ands.getKeyIndexes('mget', ['key1', 'key2']) // [0, 1]
Thank @Yuan Chuan for the package name. The original redis-commands is renamed to @yuanchuan/redis-commands.