A small ActiveRecord-style ORM built on top of Knex.js for Express.js applications. Version 4.2.2 targets Node.js 20+ and ships TypeScript types. It provides a Model base class with CRUD methods (create, find, update, delete), simple database configuration via configureDatabase, and migration helpers (makeMigration, migrateLatest, migrateRollback, etc.). Currently in maintenance mode — core functionality works but new features are limited. Differentiates from Knex by offering an ActiveRecord pattern, but requires Knex as a peer dependency and is tightly coupled to Knex's query builder.
npm install mevn-ormNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes Mevn ORM with MySQL, defines a User model, creates a record, and retrieves it by ID.
Use ES module syntax (import) and ensure Node.js >=20.
Define fillable and hidden as instance properties (override keyword) in your model classes.
Use Model.create() for new records and Model.update() for existing ones.
Call configureDatabase() once at application startup, e.g., in a server plugin or main entry point.
Run npm install knex alongside mevn-orm.
Cast model instances or use type assertions when accessing dynamic attributes.
npm install knex
Use import { configureDatabase } from 'mevn-orm'Call configureDatabase() with valid config at startup.
Switch to ESM (import) or use dynamic import.