
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
redisinsight-plugin-sdk
Advanced tools
Redis API for creating packages for Redis v.2 application
The high-level API for communication between RedisInsight plugin and RedisInsight application.
npm install redisinsight-plugin-sdk
or
yarn add redisinsight-plugin-sdk
Sets any custom text to the header of the command result
Parameters:
text
{String}Example:
import { setHeaderText } from 'redisinsight-plugin-sdk';
setHeaderText('Matched: 10')
Executes a Redis command (currently, only read-only commands are supported).
Parameters:
command
{String} - command to executeReturns:
Promise<[{ response, status }]>
/**
* @async
* @param {String} command
* @returns {Promise.<[{ response, status }]>}
* @throws {Error}
*/
Example:
import { executeRedisCommand } from 'redisinsight-plugin-sdk';
try {
const result = await executeRedisCommand('GET foo');
const [{ response, status }] = result;
if (status === 'success') {
// Do smth
}
} catch (e) {
console.error(e);
}
Returns saved state for the command visualization.
Throw an error if the state has not been saved.
Parameters:
state
{any} - any data to saveReturns:
Promise<any>
/**
* @async
* @returns {Promise.<any>} state
* @throws {Error}
*/
Example:
import { getState } from 'redisinsight-plugin-sdk';
try {
const result = await getState();
} catch (e) {
console.error(e);
}
Save the state for the command visualization.
Returns:
Promise<any>
/**
* @async
* @param {any} state
* @returns {Promise.<any>} state
* @throws {Error}
*/
Example:
import { setState } from 'redisinsight-plugin-sdk';
try {
await setState({ a: 1, b: 2 });
} catch (e) {
console.error(e);
}
Util function to parse Redis response
Returns string with parsed cli-like response
Returns:
Promise<string>
/**
* @async
* @param {any} response
* @param {String} command
* @returns {Promise.<string>} data
* @throws {Error}
*/
Example:
import { formatRedisReply } from 'redisinsight-plugin-sdk';
try {
const parsedReply = await formatRedisReply(data[0].response, command);
/*
parsedReply:
1) 1) "COUNT(a)"
2) 1) 1) "0"
3) 1) "Cached execution: 1"
2) "Query internal execution time: 3.134125 milliseconds"
*/
} catch (e) {
console.error(e);
}
FAQs
Redis API for creating packages for Redis v.2 application
The npm package redisinsight-plugin-sdk receives a total of 139 weekly downloads. As such, redisinsight-plugin-sdk popularity was classified as not popular.
We found that redisinsight-plugin-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
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.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.