node-redis-lua

1.1.0 • Public • Published

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`.

/node-redis-lua/

    Package Sidebar

    Install

    npm i node-redis-lua

    Weekly Downloads

    0

    Version

    1.1.0

    License

    none

    Last publish

    Collaborators

    • acroca
    • chenzihui