🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

@iovalkey/commands

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iovalkey/commands

Valkey commands

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
298K
2.77%
Maintainers
1
Weekly downloads
 
Created
Source

Valkey Commands

This module exports all the commands that Valkey supports.

This module was forked from @ioredis/commands at commit 4321d5d40473c48fadf49fd99662032eac9b855b

Install

$ npm install @iovalkey/commands

Usage

const commands = require('@iovalkey/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]

License

MIT

Keywords

redis

FAQs

Package last updated on 23 Jan 2025

Did you know?

Socket

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