The basic idea.
net = require("net");
var client = net.connect({port: 11211, host:"localhost"},function() {
console.log('connected');
client.write('stats\r\n');
//OR other commands + "\r\n"
client.on('data', function(data) {
console.log(data.toString());
});
client.on('end', function() {
console.log('data fetched');
});
});
Also you can use net.createServer to make your own memory cache server to support additional requirements such as PERSISTENT YOUR CACHE DATA TO MYSQL.