1.2.2 • Published 4 years ago

redis-conn-wrapper v1.2.2

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

REDIS-CONN-WRAPPER

A wrapper for node 'redis' with auto connection-closing.

Usage

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

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
1.2.2

4 years ago

1.2.0

4 years ago

1.2.1

4 years ago

1.1.1

5 years ago

1.1.0

6 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago