Registry / devops / migsi
library3.1.0jsnpmunverified

A generic Node.js migration tool (v3.1.0) for migrations with logic and queries, not just database schema changes. It supports development-mode scripts that re-run on changes, dependency-based ordering across branches, an API and CLI, and automatic output capture. Unlike database-specific tools (e.g., Knex, Sequelize), Migsi is unopinionated about backends. It requires Node.js 6+, and uses native features on Node 8+. Ships TypeScript type definitions.

npm install migsi
INSTALL
IMPORT
SIG · MIGSI
M
migsi
devopsjavascriptv3.1.0
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
import migsi from 'migsi'
const migsi = require('migsi').default
Library provides default export (the MigrationManager class).
MigrationManager
import { MigrationManager } from 'migsi'
import MigrationManager from 'migsi'
Named export also available.
getMigrationManager
import { getMigrationManager } from 'migsi'
const getMigrationManager = require('migsi').getMigrationManager
Factory function for creating migration manager instances.

Basic example using Migsi with a file-based store to run all pending migrations.

import migsi from 'migsi'; const config = { store: { type: 'file', path: './migrations.json' }, directory: './migrations' }; async function runMigrations() { const manager = migsi(config); await manager.run(); console.log('Migrations complete'); } runMigrations().catch(err => console.error(err));
Debug
Known issues
breakingMigsi v3 requires Node.js 6+; on Node 6 and 7, code is transpiled via Babel, which may cause differences in error stacks or performance.
fix
Upgrade to Node.js 8+ to avoid Babel usage.
affects: >=3.0.0
deprecatedThe Command-line tool is no longer actively maintained; API usage is recommended.
fix
Use the programmatic API (migsi(config)) instead of CLI commands.
affects: >=3.0.0
gotchaConfiguration store type 'file' is synchronous at runtime; do not use in serverless environments without a persistent filesystem.
fix
Use store type 'memory' for ephemeral envs, or implement a custom async store.
affects: >=3.0.0
gotchaDevelopment-mode scripts run every time they change; accidentally marking a production script as 'development' can cause repeated execution.
fix
Always run with --production or set isDevelopment: false in migration script metadata.
affects: >=3.0.0
breakingUnrelated migration scripts that share dependencies may cause conflicts; dependency declarations are explicit but cyclic dependencies are not detected.
fix
Manually ensure no cyclic dependencies among migration scripts.
affects: >=3.0.0
Errors
Common errors & fixes
Error: Cannot find module 'migsi'
Package not installed or import path wrong.
fix
Run 'npm install migsi' and use correct import: import migsi from 'migsi'
TypeError: migsi is not a function
Using default import from CommonJS incorrectly.
fix
Use 'import migsi from 'migsi'' (ESM) or 'const migsi = require('migsi')' (CJS). Do not use .default.
ValidationError: store is required
Configuration object missing 'store' key.
fix
Include config.store with 'type' (e.g., 'file') and 'path'.
Error: Migration script 'xxx' is not a function
Migration module exports an object instead of a function.
fix
Ensure migration script exports a function that returns a Promise or uses async.
Upgrade
Version history
3.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
packagemigsi
migsi — npm install migsi · libregistry