Registry / database / redis-orm-node

redis-orm-node

JSON →
library0.0.14jsnpmunverified

redis-orm-node is a lightweight Object-Relational Mapping (ORM) library for Node.js that simplifies interaction with Redis by mapping JavaScript objects to Redis data structures. Current stable version is 0.0.14, released irregularly as a new project. It is inspired by TypeORM and provides decorator-based entity definitions, repository pattern, and support for Redis types like strings, hashes, sets, lists, and sorted sets. Key differentiators include TypeScript-first design, integration with node-redis (v4), and a familiar ORM-like API for Redis. However, it is early-stage and may lack production readiness or comprehensive documentation.

npm install redis-orm-node
INSTALL
IMPORT
SIG · REDIS-ORM-NODE
R
redis-orm-node
databasejavascriptv0.0.14
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.

Entity
import { Entity } from 'redis-orm-node'
const { Entity } = require('redis-orm-node');
ESM-only; CommonJS require may work if the package supports it but typescript definitions assume ESM.
PrimaryColumn
import { PrimaryColumn } from 'redis-orm-node'
import PrimaryColumn from 'redis-orm-node';
Named export, not default export.
Column
import { Column } from 'redis-orm-node'
getRepository
import { getRepository } from 'redis-orm-node'
import { Repository } from 'redis-orm-node';
Repository class is not directly exported; use getRepository function.

Shows basic setup with entity definition, repository creation, CRUD operations using redis-orm-node.

import 'reflect-metadata'; import { Entity, PrimaryColumn, Column, getRepository, init } from 'redis-orm-node'; import { createClient } from 'redis'; @Entity() class User { @PrimaryColumn() id: string; @Column() name: string; @Column() email: string; } const client = createClient({ url: process.env.REDIS_URL ?? 'redis://localhost:6379' }); await client.connect(); await init(); // required once const userRepo = getRepository(User); // Create const newUser = new User(); newUser.id = '1'; newUser.name = 'Alice'; newUser.email = 'alice@example.com'; await userRepo.save(newUser); // Find by id const user = await userRepo.findOne('1'); console.log(user); // Update user.name = 'Bob'; await userRepo.save(user); // Delete await userRepo.delete('1'); await client.quit();
Debug
Known issues
breakinginit() function must be called before using any repository. Failing to do so will cause 'Database not initialized' error.
fix
Add 'await init();' after creating the Redis client and before calling getRepository.
affects: >=0.0.1
gotchareflect-metadata must be imported at the top of the entry file for decorators to work.
fix
Add 'import "reflect-metadata";' at the very top of your application entry point.
affects: >=0.0.1
deprecatedThe package is in early alpha; API may change without notice. Versions below 1.0.0 are considered unstable.
fix
Pin exact version and monitor GitHub for breaking changes.
affects: <1.0.0
gotchaRedis client must be connected before calling init(). Otherwise, operations will fail.
fix
Ensure 'await client.connect();' is called before 'await init();'.
affects: >=0.0.1
breakingPrior to v0.0.10, the package was named 'redis-orm-nod' (typo). Reinstall using new name 'redis-orm-node'.
fix
Uninstall old package: 'npm uninstall redis-orm-nod' and install 'npm install redis-orm-node'.
affects: <0.0.10
Errors
Common errors & fixes
Error: Database not initialized
init() was not called before using repository.
fix
Call 'await init();' after connecting the Redis client.
Reflect.getMetadata is not a function
reflect-metadata polyfill is missing.
fix
Install reflect-metadata: 'npm install reflect-metadata' and import it at the top of your entry file: 'import "reflect-metadata";'
Cannot find module 'redis-orm-node'
Package not installed or incorrect package name.
fix
Install the package: 'npm install redis-orm-node'. Ensure you are using the correct name (not 'redis-orm').
Upgrade
Version history
0.0.14latest on npm
Audit
Dependencies
redisrequiredPeer dependency: the underlying Redis client for Node.js (v4).
Agent activity
8 hits · last 30 days
node
6
Meta
1
Resources
redis-orm-node — npm install redis-orm-node · libregistry