Lured is a Lua script loader for Redis that simplifies loading and managing multiple Lua scripts. Version 1.0.3 is the latest stable release, with a slow release cadence. It automatically computes SHA1 hashes for each script and exposes them to the user, enabling direct use with EVALSHA in MULTI commands. Key differentiators: it provides SHA values for full control, supports auto-reload on reconnection, and optimizes with SCRIPT EXISTS before SCRIPT LOAD to reduce network traffic. Unlike other loaders that hide SHAs, lured gives developers access to them.
npm install luredNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a lured instance, loads a Lua script into Redis, and executes it using EVALSHA with the provided SHA.
Ensure client is ready (e.g., listen to 'ready' event) before loading.
Do not assume scripts object is immutable; SHAs are filled after load.
Upgrade to v1.0.0+ and update event listeners to accept two arguments.
Use the original scripts variable instead of lured.scripts.
Use the 'state' event to track actual readiness (state 3 = READY) instead of relying on load callback alone.
Start Redis server: redis-server
Use const lured = require('lured'); then lured.create(client, scripts);Install and require redis: npm install redis
Verify scripts object keys (e.g., scripts.foo) exist and are correctly cased.