Nietzsche's Preposterous Moustache

npm

Does your artifact manager get in the way? Join us on Oct. 8 at 10am PT, to discuss how npm can help.Sign up »

redis-proto

2.1.0 • Public • Published

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.

install

npm i redis-proto

Downloadsweekly downloads

664

version

2.1.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability