npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

redis-orm-lite

v1.0.9

Published

A lightweight Redis ORM with a Mongoose-like API (find, findOne, updateMany, skip, limit, sort, etc.)

Downloads

17

Readme

Redis ORM Lite

A lightweight Redis ORM for Node.js with a Mongoose-like API.
Supports:

  • .create()
  • .find()
  • .findOne()
  • .findById()
  • .updateOne()
  • .updateMany()
  • .deleteOne()
  • .deleteMany()
  • .findOneAndUpdate()
  • .findOneAndDelete()
  • .countDocuments()
  • Query chaining: .sort(), .skip(), .limit(), .exec()

📦 Requirements

  • Node.js ≥ 16
  • A running Redis server (local, Docker, or cloud)
  • TypeScript ≥ 5 (recommended)

⚡ Installation

1. From npm (if published)

npm install redis-orm-lite

2. Local installation (without publishing)

# From your CRUD app
npm install ../path-to/redis-orm-lite

Or using npm link for live development:

cd ../path-to/redis-orm-lite
npm link

cd ../crud-app
npm link redis-orm-lite

📖 Usage Example

import { RedisModel, connectRedis } from "redis-orm-lite";

interface User {
  id?: string;
  name: string;
  email: string;
  age: number;
}

// Connect to Redis
await connectRedis("redis://localhost:6379");

// Create model
const UserModel = new RedisModel<User>("User");

(async () => {
  // Create documents
  const alice = await UserModel.create({
    name: "Alice",
    email: "[email protected]",
    age: 25,
  });
  await UserModel.create({ name: "Bob", email: "[email protected]", age: 30 });
  await UserModel.create({ name: "Charlie", email: "[email protected]", age: 40 });

  // Find with query + chaining
  const adults = await UserModel.find({ age: { $gte: 18 } })
    .sort({ age: -1 })
    .skip(0)
    .limit(10)
    .exec();

  console.log("Adults:", adults);

  // Find one
  const firstAdult = await UserModel.findOne({ age: { $gte: 18 } });
  console.log("First adult:", firstAdult);

  // Find by ID
  if (alice.id) {
    const userById = await UserModel.findById(alice.id);
    console.log("Find by ID:", userById);
  }

  // Count documents
  const count = await UserModel.countDocuments({ age: { $gte: 18 } });
  console.log("Adult count:", count);

  // Update one
  const updatedOne = await UserModel.updateOne({ id: alice.id }, { age: 26 });
  console.log("Updated one:", updatedOne);

  // Update many
  const updatedMany = await UserModel.updateMany(
    { age: { $lt: 25 } },
    { age: 25 }
  );
  console.log("Updated many:", updatedMany);

  // Delete one
  const deletedOne = await UserModel.deleteOne({ id: alice.id });
  console.log("Deleted one:", deletedOne);

  // Delete many
  const deletedMany = await UserModel.deleteMany({ age: { $gte: 100 } });
  console.log("Deleted many:", deletedMany);

  // Find one and update (returns updated doc if returnNew: true)
  const findUpdate = await UserModel.findOneAndUpdate(
    { email: "[email protected]" },
    { age: 35 },
    { returnNew: true }
  );
  console.log("Find and update:", findUpdate);

  // Find one and delete
  const findDelete = await UserModel.findOneAndDelete({ age: { $gte: 35 } });
  console.log("Find and delete:", findDelete);
})();

🔑 Supported Query Operators

  • $gt → greater than
  • $gte → greater than or equal
  • $lt → less than
  • $lte → less than or equal
  • $in → value in array
  • $nin → value not in array
  • $ne → not equal

🛠 Features

  • Mongoose-like API over Redis
    • .create(), .find(), .findOne(), .findById()
    • .updateMany(), .updateOne()
    • .deleteMany(), .deleteOne()`
    • .countDocuments()
  • Query chaining
    • .sort({ field: 1 | -1 })
    • .skip(n)
    • .limit(n)
    • .exec()
  • UUID-based _id fields
  • Works with any Redis deployment (local, Docker, or cloud)