Simple, pluggable async database migration tool for Node.js >= 12.0.0. Current stable version is 2.0.5. It follows the UNIX philosophy of 'do one thing and do it well': it does not include a CLI for creating migration files. adbm is database-agnostic and requires an adapter for data persistence (e.g., adbm-mongodb). It supports both 'up' and 'down' migration directions, custom migration directories, exclusion of specific migrations, and injection of custom logging. Unlike other migration tools (e.g., migrate, db-migrate), adbm is lightweight, has no CLI, and relies on adapters for different databases. Released as needed; no fixed cadence.
npm install adbmNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Connects to MongoDB, creates adbm instance with custom migrations directory, runs all pending migrations, and logs results.
Use .js files with module.exports. For TypeScript, compile to .js or use ts-node with CJS mode.
Verify adapters' signatures. For adbm-mongodb, pass the Db object from MongoClient.db().
Prefix filenames with numeric order (e.g., 001, 002) to ensure correct execution order.
Pass custom getMigrationObjects function in the third argument as shown in the example, but be aware it may change.
Change to: import { adbm } from 'adbm'Run: yarn add adbm-mongodb or npm install adbm-mongodb
Ensure you pass db = client.db() after connecting, not the client itself.