
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@blued-core/redis-client
Advanced tools
基于 redis 的一层封装。
npm i @blued-core/redis-client
API与 Redis 保持一致,内置定时更新 Client 之类的功能。
cache 与 redis-conf 组件都为可选的,可以自己根据描述自定义
使用方式:
import Cache from '@blued-core/cache'
import { RedisConf } from '@blued-core/redis-conf'
import RedisClient from '@blued-core/redis-client'
const redisConf = new RedisConf({
redis1: 'XXX',
redis2: 'XXX',
})
async function main () {
// 如不想使用 Cache 则可以使用 Map 代替
// v0.2.0 支持回调方法,通过第6个参数传递 cb 方法, 下面传递了 console.log
// 调用 cb 时的参数是 (command: string, args: (string|number)[], result: any)
const redisClient = new RedisClient(redisConf, new Cache(), true, 1000, 3, { cb: console.log })
const redis1 = () => redisClient.getClient('redis1')
const redis2 = () => redisClient.getClient('redis2')
// cb示例: cb('set', [ 'a', 11 ], 'OK')
await redis1().set('a', 11)
// cb示例: cb('get', [ 'a' ], '11')
await redis1().get('a')
console.log(await redis1().hmget(`hashkey`, 'field1', 'field2'))
console.log(await redis2().zscore(`zsetkey`, 'values'))
}
main()
FAQs
基于 redis 的一层封装。
We found that @blued-core/redis-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.