General-purpose migration and seeding framework for Node.js, built with TypeScript. v0.4.0 provides Migrator and Seeder classes to run upgrade/downgrade migrations and repeatable seed operations with a simple index-based sequence. Lightweight, actively maintained, and production-tested. Unlike database-specific tools, it keeps the context generic via a user-supplied ctx object, making it suitable for any data or configuration migration need. Migrations track state via a local cache file, while seeds run without persistence. Supports loading migrations from directories. Requires a Promise polyfill in older environments.
npm install migratableNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage of Migrator (upgrade/downgrade) and Seeder (perform) with context and error handling.
Add './migratable.cache' to your .gitignore file.
Always append new migrations with a higher index. Never change the index of an already-applied migration.
Install 'promise-polyfill' and import it before using migratable.
For new projects, prefer a more modern migration tool.
Ensure each file in the migrations/seeds directory exports the required functions as named exports or a default object.
Run 'npm install migratable' and use correct import: import { Migrator } from 'migratable'.Install a Promise polyfill like 'promise-polyfill' and import it before migratable.
Ensure you imported Migrator correctly: import { Migrator } from 'migratable' and instantiated with 'new Migrator()'.Set cacheFilePath to a writable location or create the parent directory.