• This repository has been archived on 22/Nov/2019
  • Stars
    star
    304
  • Rank 132,079 (Top 3 %)
  • Language
    JavaScript
  • License
    BSD 3-Clause "New...
  • Created over 13 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Node wrapper for hiredis

Use node-redis

hiredis-node is deprecated, unmaintained and not updated in forever. Use node-redis.


Build Status

hiredis-node

Node extension that wraps hiredis. Because Node is already good at doing I/O, hiredis-node only provides bindings to the protocol parser. The hiredis protocol parser is faster than JavaScript protocol parsers, but the speedup only becomes noticeable for large replies. If you use Redis for simple SET/GET operations, there won't be a big benefit to using hiredis. If you use Redis for big SUNION/SINTER/LRANGE/ZRANGE operations, the benefit to using hiredis-node can be significant.

Install

Install with NPM:

npm install hiredis

This requires:

  • gcc / g++ 4.8 or newer.
  • python 2.7 or any newer 2.x version. python 3.x is not supported.

For running on Travis check the bundled .travis.yml.

Contribute

To work on the code, first fetch the bundled hiredis submodule, then build hiredis and run the tests.

git submodule update --init
npm install
npm test

Usage

hiredis-node works out of the box with Matt Ranney's node_redis. The latter has an optional dependency on hiredis-node, so maybe you're already using it without knowing.

Alternatively, you can use it directly:

var hiredis = require("hiredis"),
    reader = new hiredis.Reader();

// Data comes in
reader.feed("$5\r\nhello\r\n");

// Reply comes out
reader.get() // => "hello"

Instead of returning strings for bulk payloads, it can also return buffers:

var hiredis = require("hiredis"),
    reader = new hiredis.Reader({ return_buffers: true });

// Data comes in
reader.feed("$5\r\nhello\r\n");

// Reply comes out
reader.get() // => <Buffer 68 65 6c 6c 6f>

Windows

Since Version 0.3.0 hiredis-node officially supports Windows. A simple npm install hiredis should just work. If not, please open a bug report.

There's also a Windows fork by Dmitry Gorbunos (@fuwaneko), which should now be unnecessary.

License

This code is released under the BSD license, after the license of hiredis.

More Repositories

1

redis

Redis is an in-memory database that persists on disk. The data model is key-value, but many different kind of values are supported: Strings, Lists, Sets, Sorted Sets, Hashes, Streams, HyperLogLogs, Bitmaps.
C
64,881
star
2

go-redis

Redis Go client
Go
19,143
star
3

node-redis

Redis Node.js client
TypeScript
16,619
star
4

ioredis

πŸš€ A robust, performance-focused, and full-featured Redis client for Node.js.
TypeScript
13,878
star
5

redis-py

Redis Python Client
Python
12,153
star
6

jedis

Redis Java client
Java
11,542
star
7

hiredis

Minimalistic C client for Redis >= 1.2
C
6,040
star
8

redis-rb

A Ruby client library for Redis
Ruby
3,942
star
9

redis-doc

Redis documentation source code for markdown and metadata files, conversion scripts, and so forth
Shell
2,304
star
10

rueidis

A fast Golang Redis client that supports Client Side Caching, Auto Pipelining, Generics OM, RedisJSON, RedisBloom, RediSearch, etc.
Go
2,150
star
11

redis-om-node

Object mapping, and more, for Redis and Node.js. Written in TypeScript.
TypeScript
1,092
star
12

redis-om-python

Object mapping, and more, for Redis and Python
Python
982
star
13

redis-io

Application running http://redis.io
Ruby
637
star
14

redis-om-spring

Spring Data Redis extensions for better search, documents models, and more
Java
552
star
15

hiredis-py

Python wrapper for hiredis
C
486
star
16

redis-om-dotnet

Object mapping, and more, for Redis and .NET
C#
419
star
17

hiredis-rb

Ruby wrapper for hiredis
Ruby
317
star
18

riot

🧨 Get data in & out of Redis with RIOT
Java
227
star
19

NRedisStack

Redis Stack .Net client
C#
174
star
20

redis-rcp

Redis Change Proposals
138
star
21

redis-hashes

Redis tarball SHA1 hashes
86
star
22

redis-specifications

A bin for Redis' specs
33
star
23

redis-benchmarks-specification

The Redis benchmarks specification describes the cross-language/tools requirements and expectations to foster performance and observability standards around redis related technologies. Members from both industry and academia, including organizations and individuals are encouraged to contribute.
Python
24
star
24

redis-debian

Debian packaging
Shell
16
star
25

librdb

Redis RDB file parser, with JSON, RESP and RDB-loader extensions
C
16
star
26

redis-snap

A repository for snap packaging
10
star
27

redis-website

HTML
9
star
28

docs

Documentation for Redis, Redis Cloud, and Redis Enterprise
Python
8
star
29

redis-clinterwebz

Python
4
star
30

redis-extra-ci

4
star
31

redis-rpm

Shell
2
star