AGG++ Commands
This module exports all the commands that AGG++ supports.
Install
$ npm install agg-commands
Usage
var commands = require('agg-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('get') // true
commands.exists('other-command') // false
.hasFlag()
is used to check if the command has the flag:
commands.hasFlag('GET', 'readonly') // false
.getKeyIndexes()
is used to get the indexes of keys in the command arguments:
commands.getKeyIndexes('INC', ['key', 'value']) // [0]
commands.getKeyIndexes('GET', ['key1']) // [0]