Research
Recent Trends in Malicious Packages Targeting Discord
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
redisinsight-plugin-sdk
Advanced tools
Readme
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
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.
Research
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
Security News
Socket CEO Feross Aboukhadijeh joins a16z partners to discuss how modern, sophisticated supply chain attacks require AI-driven defenses and explore the challenges and solutions in leveraging AI for threat detection early in the development life cycle.
Security News
NIST's new AI Risk Management Framework aims to enhance the security and reliability of generative AI systems and address the unique challenges of malicious AI exploits.