hiredis-node

Node wrapper for hiredis

  • 所有者: redis/hiredis-node
  • 平台:
  • 许可证: BSD 3-Clause "New" or "Revised" License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

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.

主要指标

概览
名称与所有者redis/hiredis-node
主编程语言JavaScript
编程语言Makefile (语言数: 4)
平台
许可证BSD 3-Clause "New" or "Revised" License
所有者活动
创建于2010-11-23 10:10:57
推送于2019-11-21 14:28:53
最后一次提交2019-11-21 15:28:52
发布数20
最新版本名称v0.5.0 (发布于 2016-06-11 12:28:06)
第一版名称v0.1.1 (发布于 )
用户参与
星数305
关注者数22
派生数79
提交数189
已启用问题?
问题数94
打开的问题数10
拉请求数27
打开的拉请求数4
关闭的拉请求数18
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?