https://github.com/raykitajima/hiredis-simple
Synchronous redis binding for node.js.
https://github.com/raykitajima/hiredis-simple
Last synced: 2 months ago
JSON representation
Synchronous redis binding for node.js.
- Host: GitHub
- URL: https://github.com/raykitajima/hiredis-simple
- Owner: RayKitajima
- License: gpl-3.0
- Created: 2013-12-06T13:07:10.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2020-06-16T05:46:50.000Z (about 6 years ago)
- Last Synced: 2025-02-02T09:47:34.965Z (over 1 year ago)
- Language: C++
- Homepage:
- Size: 35.2 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hiredis-Simple
Synchronous, blocking redis binding for node.js.
This modules requires hiredis C library on your system.
## Preparation
git clone https://github.com/redis/hiredis
cd hiredis
make && make install
## Installation
npm install hiredis-simple
## Supported commnads
GET/SET/DEL/LPUSH/RPUSH/LRANGE/LPOP/RPOP/EXIST/INCR/INCRBY/DECR/DECRBY
SADD/SMEMBERS/SRANDMEMBER/RANDOMKEY
SELECT
FLUSHDB/FLUSHALL
## Examples
```javascript
var HiredisSimple = require('hiredis-simple');
var redis = new HiredisSimple.Client();
redis.connect("127.0.0.1",6379);
redis.set("key1","value1");
var value1 = redis.get("key1");
redis.expire("key1",86400);
redis.lpush("list1","value1"); // can push one-by-one
redis.rpush("list1","value2");
var array = redis.lrange("list1",0,-1);
var value1 = redis.lpop("list1");
var value2 = redis.rpop("list1");
redis.disconnect();
```
## Note
Node 0.8, 0.10, 0.11+ supported.