You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

node-redis-scripty

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-redis-scripty

Redis script manager for node.js

0.0.6
latest
Source
npmnpm
Version published
Weekly downloads
26K
9.74%
Maintainers
1
Weekly downloads
 
Created
Source

DEPRECATED

Use https://github.com/TheDeveloper/node-redis-script instead.

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);
  });
});

Keywords

redis

FAQs

Package last updated on 25 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts