1.1.0 • Published 8 years ago

node-redis-lua v1.1.0

Weekly downloads
2
License
-
Repository
github
Last release
8 years ago

Lua scripts for redis-node

Injects all .lua files as commands to node-redis instances.

Usage

To inject your scripts first you need to load them:

lua_scripts = require('redis-lua')("/path/to/scripts/folder")

Then inject them to your redis instances:

redis = require('redis').createClient(...)
lua_scripts(redis)

Scripts filename format

The filename of your scripts must follow this format:

{command}_{#keys}.lua

For example:

msismember_1.lua # creates the msismember command, with 1 arguments for `KEYS`, the rest for `ARGV`
mscard_n.lua # creates the mscard command, with all arguments sent as `KEYS`.