A super-lightweight Redis Protocol Encoder and Decoder in Javascript.
npm install --save redis-proto
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']
}
export function encode(request: any): string
export function decode(content: Buffer | string): Array<any>
export function *decodeGen(content: Buffer | string): Generator<any, void, void>
This project is licensed under the terms of MIT License. See the LICENSE file for more info.