Skip to content

vpArth/redis-lua-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status NPM version

redis-lua-helper

Lua scripts helper for RedisClient

Install

npm install redis-lua-loader

##Usage:

  var Lua = require('redis-lua-loader');
  //create helper and link to RedisClient
  client.lua = new Lua(client);
  //flush all lua scripts
  client.lua.flush();
  //load new script
  client.lua.load('some script', 'return {KEYS[1], ARGV[1]+ARGV[2]+ARGV[3]}');
  //run lua script(waitRun will wait when script will be loaded)
  client.lua.waitRun('some script',{
    keys: ['key1'],
    argv: [1,2,3]
  }, function(err, res){
    console.log(res);// ['key1', 6]
  })

About

Small helper for lua scripting for RedisClient

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published