mranney/node_redis — pull request #148 by dayananda-n (2011-11-03 11:14:29+00:00)
Title: Support for retrieving data as Buffer on a per command basis

This is achieved by introducing a new option to the createClient method called bufferedInput.
If bufferedInput is set to true, then the returned data will be a Buffer if the command argument passed is a buffer, unlike the returnBuffers, which applies to all the commands

This is basically inspired by Jedis node.js Java library which returns a ByteArray if the arguments are passed as byte array.

E.g.
var redis = require("redis"),
client = redis.createClient(, , {buffered_input: true});

client.set("foo_rand000000000000", "OK");

// The below get request will return a utf8 string
client.get("foo_rand000000000000", function (err, reply) {
console.log(reply.toString()); // Will print `OK`
});

// The below get request will return a Buffer as the key is specified as a Buffer
client.get(new Buffer("foo_rand000000000000"), function (err, reply) {
console.log(reply.toString()); // Will print ``
});
client.end();