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

mondel

v0.3.1

Published

Lightweight TypeScript ORM for MongoDB - Type-safe, serverless-optimized

Readme


Overview

Mondel is a thin, type-safe ODM for MongoDB: schema definition, typed collection access (db.users), Zod validation on writes, and a CLI for indexes/validators. Filters and operators stay native MongoDB — no new query language, no document hydration magic.

Optimized for serverless (Cloudflare Workers, Vercel Edge, Lambda) and solid on long-running Node servers.

Features

  • Typed collections — schema names and fields inferred with TypeScript
  • Serverless-ready — factory client; no startup index sync required
  • Zero magic — plain objects in/out; escape hatch via getCollection()
  • Zod validationstrict | loose | off on writes
  • CLI pull/push — introspect DB or apply indexes/JSON Schema in CI
  • MongoDB 6–8 — works with current server and driver majors

Installation

npm install mondel mongodb zod

Requirements

| | | | --- | --- | | Node.js | 18+ (20+ recommended with mongodb@7) | | MongoDB | 6.0 – 8.x | | Peers | mongodb ^6 || ^7, zod ^3.24 || ^4 |

Quick Start

import { defineSchema, s, createClient, type SchemasToClient } from "mondel";

export const userSchema = defineSchema("users", {
  timestamps: true,
  fields: {
    email: s.string().required().email().unique(),
    name: s.string(),
    role: s.enum(["ADMIN", "USER"]).default("USER"),
  },
});

export const schemas = [userSchema] as const;
export type DbClient = SchemasToClient<typeof schemas>;

const connect = createClient({
  serverless: true,
  schemas,
  validation: "strict",
});

export async function getDb(uri: string): Promise<DbClient> {
  return connect(uri);
}

// Usage
const db = await getDb(process.env.MONGODB_URI!);
await db.users.create({ email: "[email protected]", name: "Ada" });
const user = await db.users.findOne({ email: "[email protected]" });
await db.close();

Push indexes in deploy/CI (not on cold start):

npx mondel push --uri "$MONGODB_URI" --schema ./dist/schemas.js --apply-validators

Collection API

| Method | Notes | | ------ | ----- | | findOne / findMany / findById | Native filters; select = runtime projection | | create / createMany | Defaults applied when validation on | | updateOne / updateMany / updateById | Plain objects → $set; validates $set | | findOneAndUpdate | Atomic find + update | | bulkWrite | Native bulk (not re-validated) | | deleteOne / deleteMany / deleteById | { soft: true } sets deletedAt | | count / exists / aggregate | | | getCollection() | Full driver access |

Documentation

Full site: https://mondel-orm.pages.dev

| | | | --- | --- | | Concepts | guide/concepts | | Compatibility | guide/compatibility | | Upgrade 0.2 → 0.3 | guide/upgrade-0.2-to-0.3 | | Comparison | guide/comparison | | CLI | guide/cli | | AI agents | llms.txt · full text | | Changelog | CHANGELOG.md |

What Mondel is not

  • Not Mongoose (no middleware / virtuals / populate)
  • Not Prisma (no relation engine or full data migrations)
  • Not a replacement for learning MongoDB query operators

Contributing

See CONTRIBUTING.md.

License

MIT © Edjo