node package manager


Adds lua scripting to node_redis

Patch redis script commands into node-redis prototype. Does not assume node-redis has been patched with scripting support so can use the standard version.

Requires: Redis scripting branch,

Install from github or with:

npm install redis-lua

To use add lua support to redis module:

redis = require('redis');

Add some redis scripts:

redis.lua('myset', 2, 'return"set", KEYS[1], KEYS[2])');

If you want to return a javascript object add a 4th truthy parameter: redis.lua('hashtest, 0, 'return"hgetall", "something")', true);

And call like a regular redis command:

r = redis.createClient();
r.myset('testing', 'surprise', redis.print);

The lua script is passed by eval first time and evalsha subsequently with fallback to eval.