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

@mostajs/orm-cli

v0.6.4

Published

Universal CLI to integrate @mostajs/orm into any project — one-shot `mostajs bootstrap` migrates a Prisma project (codemod + deps + schema convert + DDL) to 13 databases with zero code change.

Downloads

4,416

Readme

@mostajs/orm-cli

Automated migration from Prisma to @mostajs/orm.

npx @mostajs/orm-cli bootstrap scans your Prisma project, rewrites every new PrismaClient(...) site to use the @mostajs/orm-bridge (backing up the originals), installs the runtime, converts your schema, and applies DDL — in one command.

npm version License: AGPL-3.0-or-later

Zero-touch migration

cd my-existing-prisma-app
npx @mostajs/orm-cli bootstrap
npm run dev
# db.User.findMany(...) now runs on any of 13 databases. Zero code change.

That single command does :

  1. Codemod — scans the repo for new PrismaClient(...), detects each export name (prisma, db, client, default), and rewrites each site to createPrismaLikeDb() from @mostajs/orm-bridge. Originals backed up as *.prisma.bak.
  2. Install@mostajs/orm + @mostajs/orm-bridge + @mostajs/orm-adapter + server-only.
  3. Convertprisma/schema.prisma.mostajs/generated/entities.json.
  4. DDL — writes .mostajs/config.env (SQLite defaults) and creates tables.

Every step stops on error (v0.4.1+) so you never see a lying success banner.

To undo :

npx @mostajs/orm-cli install-bridge --restore --apply

Install

Zero-install (recommended)

npx @mostajs/orm-cli bootstrap

Global

npm install -g @mostajs/orm-cli
cd your/project
mostajs bootstrap

Subcommands

| Command | What it does | |---|---| | mostajs bootstrap | Full migration : codemod + install + convert + DDL | | mostajs install-bridge | Run the codemod (dry-run by default) | | mostajs install-bridge --apply | Write the codemod changes | | mostajs install-bridge --file <path> | Restrict to one file | | mostajs install-bridge --restore --apply | Revert .prisma.bak backups | | mostajs convert | Auto-detect schema (Prisma / OpenAPI / JSONSchema) and convert | | mostajs detect | Print what's detected in the project | | mostajs health | Verify Node / pnpm / schemas / entities.json state | | mostajs hash <password> [cost] | Bcrypt a password (for seed data) | | mostajs verify <password> <hash> | Check a password/hash pair | | mostajs diagnose [email] [password] | Walk through login diagnostics | | mostajs help | Usage | | mostajs version | Print version |

Interactive menu

cd your/project
mostajs

Detected schemas are listed. Pick :

1) Convert schema → EntitySchema[]
2) Configure database URIs
3) Initialize dialects (connect + create tables)
4) Tests menu (human / mobile / AI agent / curl / playwright)
5) Start services
6) Metrics & status
7) View logs
8) Health checks
9) Generate boilerplate (src/db.ts / .env.example)
s) Seeding (upload / validate / hash / apply)
b) Bootstrap — one-shot Prisma migration
i) Install bridge (codemod)
0) About / Help
q) Quit

The codemod, in detail

mostajs install-bridge is safe by default — dry-run reports what it would change, without touching files :

$ mostajs install-bridge
▶ mostajs install-bridge — scanning /home/me/my-app

Found 3 PrismaClient instantiation site(s):
  → src/lib/db.ts         (const db)
  → src/server/prisma.ts  (const prisma)
  → scripts/seed.ts       (const prisma)

Dry-run — no files written. Re-run with --apply to execute.

Detection rules :

  • Must contain import ... from '@prisma/client' AND new PrismaClient(
  • Files that already use @mostajs/orm-bridge/prisma-client are skipped (idempotent re-runs)
  • Export shape is preserved : const db, const prisma, let client, export default, and const x = ...; export { x }

Replacement format :

// Auto-generated by `mostajs install-bridge` on 2026-04-14T02:03:38Z
// Original file backed up as <this-file>.prisma.bak
// Every db/prisma/client call is now routed to @mostajs/orm (13 dialects).
import { createPrismaLikeDb } from '@mostajs/orm-bridge/prisma-client'

export const db = createPrismaLikeDb()

Supported schemas at input

The CLI auto-detects :

  • Prismaprisma/schema.prisma
  • OpenAPIopenapi.yaml, openapi.json, api.yaml, spec/openapi.yaml, …
  • JSON Schemaschemas/*.json

Conversion goes through @mostajs/orm-adapter (4 adapters).

Supported databases (13)

SQLite · PostgreSQL · MySQL · MariaDB · MongoDB · Oracle · SQL Server · CockroachDB · DB2 · SAP HANA · HSQLDB · Spanner · Sybase

Switch database by editing .mostajs/config.env (or .env) :

DB_DIALECT=postgres
SGBD_URI=postgres://user:pass@host:5432/mydb

Then re-run mostajs → menu 3 (init DDL) → menu S → 4 (apply seeds). Same code.

Project layout

your-project/
├── prisma/schema.prisma            # unchanged
├── src/lib/db.ts                   # 3 lines now (createPrismaLikeDb)
├── src/lib/db.ts.prisma.bak        # original, in case you want to revert
└── .mostajs/
    ├── config.env                  # DB_DIALECT, SGBD_URI, DB_SCHEMA_STRATEGY
    ├── generated/entities.json     # converted schema (13-DB-ready)
    ├── seeds/*.json                # one per entity, hashed by menu S → h
    └── logs/                       # convert / init / seed / dev

Example — FitZoneGym

FitZoneGym (production-grade Next.js 15 + Prisma, 40 models, 67 files importing Prisma) was migrated end-to-end with :

cd FitZoneGym
npx @mostajs/orm-cli bootstrap        # 15 PrismaClient sites rewritten, schema converted, DDL applied
# manually : add seeds to .mostajs/seeds/User.json
# manually : mostajs — menu S → h → 4
npm run dev                           # login [email protected] / alice123  → 302 + session

Files modified by the user : 0 (codemod owned them all). Login, dashboard, API routes all work on SQLite instead of MongoDB.

License

AGPL-3.0-or-later + commercial license available.

For closed-source commercial use : [email protected]

Ecosystem

Author

Dr Hamid MADANI [email protected]