Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/steelbrain/redis-proto
Redis Protocol Encode/Decode in NodeJS
https://github.com/steelbrain/redis-proto
Last synced: 10 days ago
JSON representation
Redis Protocol Encode/Decode in NodeJS
- Host: GitHub
- URL: https://github.com/steelbrain/redis-proto
- Owner: steelbrain
- License: mit
- Created: 2015-04-04T08:51:40.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-12-13T16:20:01.000Z (almost 6 years ago)
- Last Synced: 2024-08-08T17:29:54.908Z (3 months ago)
- Language: JavaScript
- Size: 76.2 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Redis-Proto
==========[![Greenkeeper badge](https://badges.greenkeeper.io/steelbrain/redis-proto.svg)](https://greenkeeper.io/)
A super-lightweight Redis Protocol Encoder and Decoder in Javascript.
## Installation
```
npm install --save redis-proto
```## Usage
```js
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
```js
export function encode(request: any): string
export function decode(content: Buffer | string): Array
export function *decodeGen(content: Buffer | string): Generator```
## License
This project is licensed under the terms of MIT License. See the LICENSE file for more info.