node-redis-scripty
Redis script manager for node.js
Last updated 5 years ago by thedeveloper .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install node-redis-scripty 
SYNC missed versions from official npm registry.

scripty

Redis script manager for node.js.

  • Easily load scripts into Redis' script cache using scripty.loadScript.
  • Run loaded scripts using script.run();

Scripty caches the sha1 digest in an LRU cache local to the node process, allowing it to invoke the script on Redis using the hash instead of eval'ing it each time.

Scripty also guards against script flushes on Redis. If the Redis script cache is flushed or the script disappears for whatever reason, Scripty will automatically detect this and re-load the script into Redis before executing.

Requirements

  • node-redis compatible with v0.10
  • Redis v2.6 or above

Install

npm install node-redis-scripty

Usage

var redis = require('redis').createClient();

var src = 'return KEYS[1]';
var scripty = new Scripty(redis);
scripty.loadScript('blank', src, function(err, script) {
  script.run(1, 'hi', function(err, result) {
    if (err) return;

    // Should print 'hi'
    console.log(result);
  });
});

Current Tags

  • 0.0.5                                ...           latest (5 years ago)

3 Versions

  • 0.0.5                                ...           5 years ago
  • 0.0.4                                ...           6 years ago
  • 0.0.3                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 469
Last Day 1
Last Week 203
Last Month 612
Dependencies (2)
Dev Dependencies (3)

Copyright 2014 - 2016 © taobao.org |