# redis-conn-wrapper

> A wrapper for node 'redis' library.

Latest version **1.2.2** (published 2020-08-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install redis-conn-wrapper
pnpm add redis-conn-wrapper
yarn add redis-conn-wrapper
bun add redis-conn-wrapper
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.2 |
| Published | 2020-08-07 |
| First published | 2017-06-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 51.4 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | marsoln |
| Maintainers | marsoln |
| Keywords | redis, wrapper |

## Links

- npm: https://www.npmjs.com/package/redis-conn-wrapper
- Repository: https://github.com/marsoln/redis-wrapper
- Homepage: https://github.com/marsoln/redis-wrapper#readme
- Issues: https://github.com/marsoln/redis-wrapper/issues
- npm.io page: https://npm.io/package/redis-conn-wrapper

## Dependencies (2)

- [redis](https://npm.io/package/redis.md) ^2.7.1
- [@types/redis](https://npm.io/package/@types/redis.md) ^2.8.14

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.2.2 (latest) — 2020-08-07
- 1.2.1 — 2020-08-07
- 1.2.0 — 2020-08-07
- 1.1.1 — 2019-10-16
- 1.1.0 — 2018-04-18
- 1.0.4 — 2017-07-19
- 1.0.3 — 2017-06-09
- 1.0.2 — 2017-06-09
- 1.0.1 — 2017-06-09
- 1.0.0 — 2017-06-08

## README

# REDIS-CONN-WRAPPER

> A wrapper for node ['redis'](https://github.com/NodeRedis/node_redis) with auto connection-closing.

## Usage

install via yarn/npm `yarn add redis-conn-wrapper` `npm install redis-conn-wrapper`

```javascript

const wrapper = require('redis-conn-wrapper')

const redisConfig = {
    host: 'localhost',
    port: 6379,
}

let conn = wrapper(redisConfig)

// connection will auto close when it finished
conn.get('key').then((data)=> {
        //...
    }).catch((err)=> {
        //...
    })

// with obj

conn.setObj('key1', { name : 1 }).then(()=> {
    conn.getObj('key1').then(({name})=>{ console.log(`name is ${name}`)})
})

```

## Updates

- 1.0.4: change source to ES6 syntax
- 1.1.0: add setObj and getObj
- 1.1.1: change to typescript
- 1.2.0: add ts declaration, remove auto close
- 1.2.1: update dependencies
- 1.2.2: export declaration

---
_Source: https://npm.io/package/redis-conn-wrapper · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
