redjs

A redis library for node.js

redjs

Lighweight redis library for node.js

Stability: 1 - Experimental

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(errreply) {
    console.log(reply);
  });
});

Create a new client object. Client extends EventEmitter.

opt_options contains optional configuration:

{
  host: '127.0.0.1',
  port: 6379
}

opt_callback is registered as listener for the 'connect' event.

var client = redjs.createClient();
client.connect(function() {
  client.send('SET', 'keyA', '1');
  client.send('KEYS', '*', function(errreply) {
    console.log(reply);
  });
});

Or use an Array as 1st argument

client.send(['REM', 'keyA', 'keyB', 'keyC'], function(errreplies) {
  console.log(replies);
});

function(err)

Create a new parser object. Parser is a Stream.

funtion(type, value)

type is one of status, error, number, bulk, multi.

value depends on type.

funtion(err)

make jshint
make test