# hiredis

> Wrapper for reply processing code in hiredis

Latest version **0.5.0** (published 2016-06-11) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install hiredis
pnpm add hiredis
yarn add hiredis
bun add hiredis
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.0 |
| Published | 2016-06-11 |
| First published | 2011-01-05 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | separate (@types/hiredis) |
| Module format | CommonJS |
| Node | >= 0.10.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 305 |
| Author | Jan-Erik Rediger |
| Maintainers | pietern, badboy_ |

## Links

- npm: https://www.npmjs.com/package/hiredis
- Repository: https://github.com/redis/hiredis-node
- Homepage: http://github.com/redis/hiredis-node
- Issues: https://github.com/redis/hiredis-node/issues
- npm.io page: https://npm.io/package/hiredis

## Dependencies (2)

- [nan](https://npm.io/package/nan.md) ^2.3.4
- [bindings](https://npm.io/package/bindings.md) ^1.2.1

## Recent versions

- 0.5.0 (latest) — 2016-06-11
- 0.4.1 — 2015-08-22
- 0.4.0 — 2015-05-25
- 0.3.0 — 2015-04-03
- 0.2.0 — 2015-02-08
- 0.1.17 — 2014-06-02
- 0.1.16 — 2013-12-12
- 0.1.15 — 2013-03-13
- 0.1.14 — 2012-02-21
- 0.1.13 — 2011-11-13
- 0.1.12 — 2011-06-19
- 0.1.10 — 2011-05-10
- 0.1.9 — 2011-04-07
- 0.1.8 — 2011-02-08
- 0.1.6 — 2011-01-05
- … 6 more at https://npm.io/package/hiredis/versions

## README

[![Build Status](https://travis-ci.org/redis/hiredis-node.png?branch=master)](https://travis-ci.org/redis/hiredis-node)

# hiredis-node

Node extension that wraps [hiredis][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.

[hiredis]: http://github.com/redis/hiredis

## Install

Install with [NPM][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](.travis.yml).

[npm]: https://npmjs.org/

## 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][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:

```javascript
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:

```javascript
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>
```

[node_redis]: http://github.com/mranney/node_redis

## 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][windows_fork] by Dmitry Gorbunos (@fuwaneko), which should now be unnecessary.

[windows_fork]: https://github.com/fuwaneko/hiredis-node

## License

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

---
_Source: https://npm.io/package/hiredis · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
