Registry / database / mgrt
library0.2.8jsnpmunverified

A minimal database migration tool for Node.js, version 0.2.8 (last release, likely abandoned since 2014). It provides a simple CLI to create, apply (`up`), rollback (`down`), and refresh migrations. Migrations are plain JavaScript files exporting `up` and `down` functions using callback-based (success/error) or async patterns. Compared to tools like `db-migrate` or `knex`, mgrt is un-opinionated, has no built-in database adapters, and relies on custom storage backends. Designed for lightweight projects, but lacks maintenance and modern features like ESM support.

npm install mgrt
INSTALL
IMPORT
SIG · MGRT
M
mgrt
databasejavascriptv0.2.8
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
no package export; migrations are files with exports
const mgrt = require('mgrt')
mgrt is a CLI tool, not a library. Migrations export up and down functions.
up
exports.up = function(success, error) { ... }
module.exports = function up(success, error) { ... }
Each migration file must export named functions `up` and `down`.
down
exports.down = function(success, error) { ... }
module.exports = { down: ... } (but missing up)
Both exports are required, though down can be a no-op.

Installs mgrt globally, initializes a project, creates a migration, edits it, and runs up/down.

npm install -g mgrt mkdir myproject && cd myproject mgrt init mgrt create create-users-table # edit migrations/timestamp-create-users-table.js cat > migrations/template.js << 'EOF' exports.up = function(success, error) { // your migration logic success(); }; exports.down = function(success, error) { // rollback logic success(); }; EOF mgrt up mgrt down
Debug
Known issues
breakingPackage has no maintainer and broken dependencies (e.g., commander version incompatibility).
fix
Consider migrating to maintained tools like node-pg-migrate or knex.
affects: >=0
gotchaMigrations use callback-based error handling; calling `error()` does NOT throw, must manually stop.
fix
Always return after calling error() or use early return pattern.
affects: <1.0
gotchaStorage module must be synchronous get/set or async callbacks; no promise support.
fix
Wrap promise-based adapters in callback style.
affects: *
deprecatedPackage last updated in 2014; no ESM, modern Node.js features, or security patches.
fix
Switch to a maintained alternative.
affects: *
Errors
Common errors & fixes
Error: Cannot find module 'commander'
Missing or outdated dependency when installed globally.
fix
Run npm install -g mgrt@latest or install locally.
TypeError: mgrt.up is not a function
Attempting to use mgrt as a library instead of CLI.
fix
Use mgrt via command line: mgrt up
Upgrade
Version history
0.2.8latest on npm
Audit
Dependencies
commanderrequiredCLI command parsing
Agent activity
7 hits · last 30 days
node
7
Resources
packagemgrt
mgrt — npm install mgrt · libregistry