Provides a Lua script implementing the HSETEX Redis command, which sets a hash field value and simultaneously updates the key expiration. The package is at version 6.0.0, requiring Node >=20, and is designed to be used with ioredis or any Redis client that can define custom commands via Lua scripts. It differentiates by offering a single-purpose Redis extension for atomic hash set + expire operations, unlike generic Redis clients or multi-command patterns. The release cadence is irregular; updates are triggered by library compatibility or bug fixes. It is a minimal dependency with no runtime dependencies.
npm install redis-hsetexNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes ioredis with the HSETEX command using redis-hsetex, sets multiple fields, retrieves them, and demonstrates auto-expiry.
Upgrade Node to version 20 or later.
Use require() instead of import.
Ensure the first argument is the key, second is TTL in seconds, then field-value pairs.
If using node-redis, load the script via redisClient.scriptLoad(hsetex.lua).
Ensure you pass hsetex.lua as the lua property and hsetex.numberOfKeys as numberOfKeys in defineCommand.
Call redis.hsetex(key, seconds, field, value, ...). Minimum arguments: key, seconds, field, value.
Use ioredis client, or manually load the script with scriptLoad and call EVALSHA.
No dependency data recorded yet.