Abstract migration framework for Node.js with optional MongoDB state storage. Version 4.0.0 provides a CLI and programmatic API for managing database migrations. The framework supports both file-based state storage and MongoDB-based state via the MONGO_CONNECTION_STRING environment variable, allowing seamless migration from the original tj/node-migrate package. It enables creating, up, and down migration commands with custom date formats and template files.
npm install migrate-mongodbNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Quickstart: install migrate, create a migration, run it up.
Use `migrate up` explicitly if needed, or update scripts relying on older CLI syntax.
Use `--state-mongo MONGO_CONNECTION_STRING` or set env var directly.
Wrap with util.promisify or use a wrapper library.
Use the default timestamp format (milliseconds) or a date format that ensures unique ordering.
Delete the old .migrate file and re-run all migrations.
Run `npm install migrate` and use `require('migrate')`.Use `npx migrate` or `./node_modules/.bin/migrate`.
Use `const migrate = require('migrate');` then `set = migrate.load('state', 'dir');`.No dependency data recorded yet.