2.1.0 • Published 8 years ago

redis-proto v2.1.0

Weekly downloads
10
License
MIT
Repository
github
Last release
8 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

8 years ago

2.0.3

9 years ago

2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

10 years ago

1.0.0

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago