# @blued-core-oversea/ioredis-client

> 基于 ioredis 的一层封装。

Latest version **1.0.1** (published 2025-03-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install @blued-core-oversea/ioredis-client
pnpm add @blued-core-oversea/ioredis-client
yarn add @blued-core-oversea/ioredis-client
bun add @blued-core-oversea/ioredis-client
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2025-03-05 |
| First published | 2021-06-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 37.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | bluediapp |

## Links

- npm: https://www.npmjs.com/package/@blued-core-oversea/ioredis-client
- npm.io page: https://npm.io/package/@blued-core-oversea/ioredis-client

## Dependencies (3)

- [ioredis](https://npm.io/package/ioredis.md) ^5.5.0
- [node-qconf](https://npm.io/package/node-qconf.md) ^0.4.2
- [@blued-core/qconf](https://npm.io/package/@blued-core/qconf.md) ^1.0.4

## Recent versions

- 1.0.1 (latest) — 2025-03-05
- 1.0.0 — 2024-12-13
- 0.2.0 — 2023-04-04
- 0.1.0 — 2022-06-03
- 0.0.7 — 2021-08-12
- 0.0.6 — 2021-08-02
- 0.0.5 — 2021-06-30
- 0.0.4 — 2021-06-30
- 0.0.3 — 2021-06-29
- 0.0.2 — 2021-06-29
- 0.0.1 — 2021-06-29

## README

基于 ioredis 的一层封装。

```bash
npm i @blued-core-oversea/ioredis-client
```

redis client:

```typescript
export const redis: Record<string, string | RedisClientConf> = {
  test: 'xxxxxxxxxxxxx',
}

// or
export const redis: Record<string, string | RedisClientConf> = {
  test: {
    host: 'xxxxxxxxxxxxx',
    maxConnAge: 5 * 1000,
    poolSize: 3,
    verify: {        // 用户名密码【非必须项】
      userNameConf: 'xxxxxxxxxxx',
      passwordConf: 'xxxxxxxxxxx',
    }
  },
  test2: 'xxxxxxxxxxxxxx',
}


const redisClient = new RedisClient(redis, {
  commandTimeout: 100,
  maxRetry: 2000,
  enableReadyCheck: false,
})

const testRedisClient = () => redisClient.getClient('test')

async function main () {
  const test = await awsRedisClient().pipeline().type('test').type('aaaaaaaa')
      .exec()
  console.log(test)
}

main()

```

cluster redis client:

```typescript
export const redis = {
  test: 'xxxxxxxxxxxxx',
}

const redisClient = new ClusterRedisClient(redis, {
  isPingCheck: true,
  refreshDuration: 2,
})

const testRedisClient = () => redisClient.getClient('test')

async function main () {
  await testRedisClient().get('a')
}

main()

```

---
_Source: https://npm.io/package/@blued-core-oversea/ioredis-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
