๐Ÿ“ฆ fghpdf / readBitmap

๐Ÿ“„ README.md ยท 45 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45# readBitmap
read bitmap from redis 

---

## Quick Start

### Install
`npm i --save readbitmap`

### Basic Usage

```js
const readBitmap = require('readbitmap')
readBitmap('testBit').then((res) => {
  console.log(res)
})

// [0, 12, 13, 100]

// or connect remote redis server

const readBitmap = require('readbitmap')
readBitmap('testBit', { host: 'redis_host', port: 3306 }).then((res) => {
  console.log(res)
})

// or read buffer
const readBitmap = require('readbitmap')
readBitmap(Buffer.from('0123')).then((res) => {
  console.log(res)
})
```

### Params

The first param is redis bitmap key or buffer, redis config can`t work if you use buffer.

The second param is redis config, you can see [ioredis](https://github.com/luin/ioredis#connect-to-redis) to get more infomation to connect redis.

## License
MIT