A high-level Redis library
redback - A high-level Redis library for Node.JS.
npm install -g redback
Redback provides an accessible and extensible interface to the Redis data types and allows you to roll 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:
Have an idea for an advanced structure? Send a pull request and I'll add you as a contributor.
var redback = ;// orvar redis = ;var redback = ;
var user3 = redback;user3;var text = redback;text;text;var user1 = redback;user;var log = redback;log;
To create your own structure, use
Let's create a queue that can be either FIFO or LIFO
To use the queue, call
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;
For now, see the annotated source for more information.
Copyright (c) 2010 Chris O'Hara email@example.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.