This repository has been archived by the owner on Jan 4, 2018. It is now read-only.
forked from shirro/node_redis_lua
-
Notifications
You must be signed in to change notification settings - Fork 1
uber-archive/node_redis_lua
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
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: https://github.com/mranney/node_redis Redis scripting branch, https://github.com/antirez/redis/tree/scripting Install from github or with: npm install redis-lua To use add lua support to redis module: redis = require('redis'); require('redis-lua').attachLua(redis) Add some redis scripts: redis.lua('myset', 2, 'return redis.call("set", KEYS[1], KEYS[2])'); If you want to return a javascript object add a 4th truthy parameter: redis.lua('hashtest, 0, 'return redis.call("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.
About
Redis scripting for node_redis
Resources
Stars
Watchers
Forks
Packages 0
No packages published
Languages
- JavaScript 62.1%
- CoffeeScript 37.9%