2.1.0 • Published 7 years ago

redis-proto v2.1.0

Weekly downloads
10
License
MIT
Repository
github
Last release
7 years ago

Redis-Proto

A super-lightweight Redis Protocol Encoder and Decoder in Javascript.

Installation

npm install --save redis-proto

Usage

import { encode, decode, decodeGen } from 'redis-proto'

const encoded = encode(['SET', 'KEY', 'VALUE'])
const decoded = decode(encoded)

console.log(decoded[0]) // ['SET', 'KEY', 'VALUE']

for (const entry of decodeGen(encoded)) {
  console.log('entry', entry) // ['SET', 'KEY', 'VALUE']
}

API

export function encode(request: any): string
export function decode(content: Buffer | string): Array<any>
export function *decodeGen(content: Buffer | string): Generator<any, void, void>

License

This project is licensed under the terms of MIT License. See the LICENSE file for more info.

2.1.0

7 years ago

2.0.3

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.0.0

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago