lib/rejson.js
function Rejson(opts) {

  // Instantiation
  if (!(this instanceof Rejson)) {
    return new Rejson(opts);
  }

  EventEmitter.call(this);

  opts = opts || {};
  _.defaults(opts, Rejson.defaultOptions);
  var redis = new Redis(opts);


  // Add new commands
  this.cmds = {};
  for (var i in Rejson.commands) {
    var command = Rejson.commands[i];
    var cmd = redis.createBuiltinCommand(command);
    this.cmds[command] = cmd.string;
    this.cmds[command + 'Buffer'] = cmd.buffer;
  }

  this.client = redis;
  var _this = this;
  this.client.on('ready', function() {
    _this.emit('ready');
  });

}
function Rejson(opts) {

  // Instantiation
  if (!(this instanceof Rejson)) {
    return new Rejson(opts);
  }

  EventEmitter.call(this);

  opts = opts || {};
  _.defaults(opts, Rejson.defaultOptions);
  var redis = new Redis(opts);


  // Add new commands
  this.cmds = {};
  for (var i in Rejson.commands) {
    var command = Rejson.commands[i];
    var cmd = redis.createBuiltinCommand(command);
    this.cmds[command] = cmd.string;
    this.cmds[command + 'Buffer'] = cmd.buffer;
  }

  this.client = redis;
  var _this = this;
  this.client.on('ready', function() {
    _this.emit('ready');
  });

}
function Rejson ( opts ) { // Instantiation if ( ! ( this instanceof Rejson ) ) { return new Rejson ( opts ) ; } EventEmitter . call ( this ) ; opts = opts || { } ; _ . defaults ( opts , Rejson . defaultOptions ) ; var redis = new Redis ( opts ) ; // Add new commands this . cmds = { } ; for ( var i in Rejson . commands ) { var command = Rejson . commands [ i ] ; var cmd = redis . createBuiltinCommand ( command ) ; this . cmds [ command ] = cmd . string ; this . cmds [ command + 'Buffer' ] = cmd . buffer ; } this . client = redis ; var _this = this ; this . client . on ( 'ready' , function ( ) { _this . emit ( 'ready' ) ; } ) ; }
Creates a Rejson instance

@constructor
Creates a Rejson instance