Registry / database / redis-hashes

redis-hashes

JSON →
library0.6.1jsnpmunverified

Redis hash utilities for Node.js that simplify CRUD operations (save, get, search, count, remove) on Redis hashes with optional indexing for full-text search via reds. Current stable version 0.6.1 (last published 2019, no recent updates). It flattens and serializes objects before storing, supports bulk operations, and includes indexing for search queries. Alternatives include ioredis or node_redis directly for lower-level control.

npm install redis-hashes
INSTALL
IMPORT
SIG · REDIS-HASHES
R
redis-hashes
databasejavascriptv0.6.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const redis = require('redis-hashes')(options);
const redis = require('redis-hashes'); // missing function call
Package exports a factory function, not an object. Must call with options (or empty object).
hash
const hash = require('redis-hashes')({ /* options */ });
const { hash } = require('redis-hashes'); // no named export
Returned instance has methods .save, .get, .search, etc. Not a named export.
options
const client = require('redis-hashes')({ redis: 'redis://localhost:6379' });
const client = require('redis-hashes')(); // default redis host may not be set
You must provide redis connection options or string; default is likely localhost:6379.

Initializes redis-hashes, saves a user object to a Redis hash in the 'users' collection, then retrieves it by ID.

const redis = require('redis-hashes')({ redis: 'redis://localhost:6379' }); // Save a user const user = { id: 1, name: 'Alice', email: 'alice@example.com' }; redis.save(user, { collection: 'users' }, (err, saved) => { if (err) throw err; console.log('Saved:', saved); }); // Get user by ID redis.get(1, (err, user) => { if (err) throw err; console.log('User:', user); });
Debug
Known issues
breakingFrom v0.5+ all index keys use format <prefix>:indexes:<collection>:...
fix
If upgrading from <0.5, update search logic or re-index data.
affects: >=0.5.0
deprecatedPackage last updated in 2019; no active maintenance.
fix
Consider switching to ioredis or node_redis directly.
affects: >=0.6.0
deprecatedDepends on outdated 'reds' library (unmaintained).
fix
Implement search via Redisearch or custom indexing.
affects: >=0.6.0
gotchaObjects are flattened before storage; nested properties become dot-separated keys.
fix
Use dot notation when querying fields.
affects: >=0.0.0
gotchaDates are converted to timestamps during serialization.
fix
Convert timestamps back to Date when reading if needed.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Redis connection to 127.0.0.1:6379 failed
Redis server not running or wrong host/port.
fix
Start Redis server or provide correct connection in options.
TypeError: redis(...) is not a function
Calling require('redis-hashes')() without opening parentheses (second set).
fix
Use const client = require('redis-hashes')(options);
ReferenceError: reds is not defined
Missing dependency 'reds' when using search functionality.
fix
Run npm install reds and ensure it's in node_modules.
Upgrade
Version history
0.6.1latest on npm
Audit
Dependencies
redisrequiredUnderlying Redis client
redsrequiredFull-text search indexing
flatrequiredObject flattening for hash storage
Agent activity
17 hits · last 30 days
node
14
Meta
1
Amazon
1
Resources
redis-hashes — npm install redis-hashes · libregistry