Registry / database / basic-redis-factory

basic-redis-factory

JSON →
library0.0.3jsnpmunverified

A small utility to create Redis clients from connection strings or option objects, decoupled from the `redis` npm package so users can choose their own version. Version 0.0.3 is the latest and only release; the project appears to be in early draft stage with no tests, no updates since initial publication, and a stated willingness to rename APIs. It provides a synchronous factory function and a partially-applied factory pattern. Compared to more mature solutions like ioredis or node-redis' built-in URL parsing, this package is minimal and unmaintained.

npm install basic-redis-factory
INSTALL
IMPORT
SIG · BASIC-REDIS-FACTOR
B
basic-redis-factory
databasejavascriptv0.0.3
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
import redisFactory from 'basic-redis-factory';
const { default: redisFactory } = require('basic-redis-factory'); // possible but awkward
Export is a single function. CJS require works, but ESM users should use default import.
default
const redisFactory = require('basic-redis-factory');
const { redisFactory } = require('basic-redis-factory'); // not a named export
CJS require returns the factory function directly, not an object.
factory
const { factory } = require('basic-redis-factory');
const factory = require('basic-redis-factory').factory; // works but destructure is clearer
The factory property is a static method on the main export. ESM: import { factory } from 'basic-redis-factory';

Creates a Redis client from a URL string using the factory, attaches an error listener, sets a key, then quits.

import redisFactory from 'basic-redis-factory'; import redis from 'redis'; const connectionUrl = 'redis://user:mypassword@192.168.10.10:3444'; const client = redisFactory(redis, connectionUrl); client.on('error', (err) => console.error('Redis error:', err)); client.set('key', 'value', (err, reply) => { if (err) throw err; console.log('Set reply:', reply); client.quit(); });
Debug
Known issues
deprecatedPackage has no recent updates, no tests, and is marked as a first draft. It may be abandoned.
fix
Use node-redis (redis) or ioredis directly instead of this factory.
affects: 0.0.3
gotchaThe factory does not install `redis` as a dependency; you must install it separately. Missing redis will cause a runtime error.
fix
Run `npm install redis` alongside this package.
affects: >=0.0.0
gotchaOnly connection strings with the `redis://` scheme and basic auth are supported; other schemes or advanced options may not work.
fix
Pass an options object with explicit host/port/password instead of a URL.
affects: 0.0.3
Errors
Common errors & fixes
TypeError: redis.createClient is not a function
The provided `redis` module does not have a `createClient` method (e.g., older version or wrong package).
fix
Ensure you require the correct `redis` package (version 2.x or 3.x) and pass it as the first argument.
Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
No Redis server running at the default host/port when using empty options.
fix
Provide a valid Redis connection string or options object with correct host/port.
Upgrade
Version history
0.0.3latest on npm
Audit
Dependencies
redisrequiredPeer dependency — the factory requires the user to provide a 'redis' module instance to bind to.
Agent activity
16 hits · last 30 days
node
12
OpenAI (training)
1
Resources
basic-redis-factory — npm install basic-redis-factory · libregistry