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

@jkershaw/mangodb

v0.1.4

Published

File-based MongoDB drop-in replacement for TypeScript/Node.js. SQLite is to SQL as MangoDB is to MongoDB.

Downloads

1,711

Readme

MangoDB 🥭

A file-based MongoDB drop-in replacement for TypeScript/Node.js.

SQLite is to SQL as MangoDB is to MongoDB.

MangoDB stores your data as simple JSON files on disk while exposing the same API as the official MongoDB driver. Write your application once, develop locally without any database setup, then deploy to real MongoDB by changing a single environment variable.

Why MangoDB?

Working with MongoDB during development often means running local instances, configuring Docker containers, or connecting to cloud databases just to run your tests. MangoDB removes that friction entirely - your data lives in plain JSON files that you can inspect, version control, or simply delete between test runs.

The best part: when you're ready for production, your code doesn't change. Just point to a real MongoDB instance and everything works.

Installation

npm install @jkershaw/mangodb

Requires Node.js >= 22.0.0

Quick Start

import { MangoClient } from '@jkershaw/mangodb';

const client = new MangoClient('./data');
await client.connect();

const db = client.db('myapp');
const users = db.collection('users');

// Same API as MongoDB driver
await users.insertOne({ name: 'Alice', email: '[email protected]' });
const user = await users.findOne({ name: 'Alice' });

await client.close();

Switching to MongoDB

The API is identical. Only initialization differs:

import { MongoClient } from 'mongodb';
import { MangoClient } from '@jkershaw/mangodb';

// Environment-based switching
const client = process.env.MONGODB_URI
  ? new MongoClient(process.env.MONGODB_URI)
  : new MangoClient('./data');

await client.connect();
// ... rest of your code works unchanged

Documentation

| Document | Description | |----------|-------------| | Compatibility | What's supported, what's not | | Migration | Switching between MangoDB and MongoDB | | Testing | Test patterns and best practices | | Edge Cases | Behavioral quirks and gotchas | | Examples | Framework integration examples | | API Reference | Quick reference for all operations | | Troubleshooting | Common issues and solutions | | Initial Prompt | The original AI prompt that started this project |

Feature Coverage

| Category | Coverage | |----------|----------| | Query Operators | 31/32 (97%) | | Update Operators | 20/20 (100%) | | Aggregation Stages | 29/34 (85%) | | Expression Operators | 121/127 (95%) | | Index Types | 9/9 (100%) |

See COMPATIBILITY.md for details.

When to Use MangoDB

Ideal for:

  • Local development without MongoDB setup
  • Unit and integration testing
  • CI/CD pipelines (no database service needed)
  • Prototyping and learning
  • Small datasets (< 10,000 documents)

Not recommended for:

  • Production deployments
  • Large datasets
  • Multi-process access
  • Applications requiring transactions

Running Tests

# Run against MangoDB
npm test

# Run against MongoDB (requires MongoDB instance)
MONGODB_URI=mongodb://localhost:27017 npm test

Both modes should pass for full compatibility.

License

MIT