Registry / database / fibjs_redis

fibjs_redis

JSON →
library1.4.10jsnpmunverified

A Redis client for the fibjs runtime (not Node.js), written in JavaScript with full TypeScript type declarations. Current version 1.4.10, actively maintained. Supports all major Redis features: pipeline, MULTI/EXEC transactions, Pub/Sub, Lua scripting, and Redis 4.0+ APIs. Key differentiators: targets fibjs (not Node.js), provides type casting utilities (castNumber, castBigInt), and includes blocking commands. Fibjs-specific engines requirement (>0.32.0) means it cannot be used with standard Node.js.

npm install fibjs_redis
INSTALL
IMPORT
SIG · FIBJS_REDIS
F
fibjs_redis
databasejavascriptv1.4.10
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.

Redis
import { Redis } from 'fibjs_redis'
const Redis = require('fibjs_redis')
ESM import is preferred; CommonJS also works with .Redis property.
castNumber
import { castNumber } from 'fibjs_redis'
const { castNumber } = require('fibjs_redis')
Available as named import; also accessible as Redis.castNumber.
castBigInt
import { castBigInt } from 'fibjs_redis'
import { CastBigInt } from 'fibjs_redis'
Case-sensitive: castBigInt not CastBigInt.

Shows basic Redis operations: SET, GET with optional TTL, numeric type casting, and pipeline usage.

import { Redis } from 'fibjs_redis'; const redis = new Redis(); console.log(redis.ping()); redis.set('key', 'value', 10); console.log(redis.get('key')); redis.set('num', 123); console.log(typeof redis.get('num')); // string console.log(typeof redis.get('num', Redis.castNumber)); // number const pipe = redis.pipeOpen(); pipe.set('a', '1'); pipe.get('a'); const results = pipe.pipeSubmit(); console.log(results);
Debug
Known issues
gotchaBlocking commands (BLPOP, BRPOP, etc.) block the entire fibjs fiber; do not use shared Redis object concurrently.
fix
Use separate Redis instances for blocking operations.
affects: >=1.0
gotchaAfter MULTI/EXEC or SUBSCRIBE, do not issue other commands on the same connection; MULTI/EXEC may interleave with other fibers.
fix
Use a dedicated Redis instance for transactions or subscriptions.
affects: >=1.0
gotchaAll values retrieved via GET are strings by default; use castNumber or castBigInt to coerce types.
fix
Call redis.get('key', Redis.castNumber) for numeric results.
affects: >=1.0
Errors
Common errors & fixes
Error: Module 'fibjs_redis' not found
fibjs_redis is not a Node.js package; requires fibjs runtime.
fix
Install fibjs and run scripts with 'fibjs script.js' instead of 'node script.js'.
TypeError: redis.get(...) is not a function
Using require incorrectly; fibjs_redis exports an object with Redis class.
fix
Use const Redis = require('fibjs_redis').Redis; or import { Redis } from 'fibjs_redis';.
TypeError: Redis.castNumber is undefined
Importing wrong symbol; castNumber is a named export, not a property of default import.
fix
Import castNumber explicitly: import { castNumber } from 'fibjs_redis';.
Upgrade
Version history
1.4.10latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
10
Resources
fibjs_redis — npm install fibjs_redis · libregistry