A high-level Redis library
A high-level Redis library.
$ npm install redback
Redback provides an accessible and extensible interface to the Redis data types and allows you to create your own structures with ease. Redback comes with the following built-in structures: List, Set, SortedSet, Hash, Channel, Cache
It also comes with the following advanced data structures:
var redback = ;// orvar redis = ;var redback = ;
var user3 = redback;user3;var log = redback;log;var user = redback;user;
addStructure(name, methods) to create your own structure.
Let's create a queue that can be either FIFO or LIFO:
createSimpleQueue(key, options) to use the queue:
var queue = redback;queue;
Structures have access to a Redis key
this.key and the Redis client
this.client. If an
init() method is defined then it is called after
the structure is instantiated. Also note that
init() receives any extra parameters
var cache = redback;cache;cache;
var channel = redback;//To received messageschannel;//To send messageschannel;
See the annotated source.
The tests require a local redis instance running on
localhost:6379. Note that
the redis database will be flushed prior to each test invocation.
$ npm test