0.0.17 • Published 13 years ago
redjs v0.0.17
redjs
Lighweight redis library for node.js
Stability: 1 - Experimentalapi
createDriver(opt_options)
Create a new driver object. Driver extends Client.
On load the all commands from lib/commands.js are populated on the drivers prototype.
var driver = redjs.createDriver();
driver.connect(function() {
driver.set('testkey', 'a', function(err, reply) {
console.log(reply);
});
});createClient(opt_options)
Create a new client object. Client extends EventEmitter.
opt_options contains optional configuration:
{
host: '127.0.0.1',
port: 6379
}client.connect(opt_callback)
opt_callback is registered as listener for the 'connect' event.
client.send(var_args, opt_callback)
var client = redjs.createClient();
client.connect(function() {
client.send('SET', 'keyA', '1');
client.send('KEYS', '*', function(err, reply) {
console.log(reply);
});
});Or use an Array as 1st argument
client.send(['REM', 'keyA', 'keyB', 'keyC'], function(err, replies) {
console.log(replies);
});Event: 'connect'
Event: 'error'
function(err)
createParser()
Create a new parser object. Parser is a Stream.
parser.write(buffer)
Event: 'reply'
funtion(type, value)
type is one of status, error, number, bulk, multi.
value depends on type.
Event: 'error'
funtion(err)
tests
make jshint
make test0.0.17
13 years ago
0.0.16
13 years ago
0.0.15
13 years ago
0.0.14
13 years ago
0.0.13
13 years ago
0.0.12
13 years ago
0.0.11
13 years ago
0.0.10
13 years ago
0.0.9
13 years ago
0.0.8
13 years ago
0.0.7
13 years ago
0.0.6
13 years ago
0.0.5
13 years ago
0.0.4
13 years ago
0.0.3
13 years ago
0.0.2
13 years ago
0.0.2-dev
13 years ago
0.0.1
13 years ago