Registry / database / dynamodb-migrate

dynamodb-migrate

JSON →
library1.0.2jsnpmunverified

A lightweight migration framework for Amazon DynamoDB, version 1.0.2. It provides a simple way to manage schema and data migrations in DynamoDB, similar to ActiveRecord migrations in Rails. It scans a local 'dynamo-migrations' folder for numbered migration files and applies them sequentially. The package is minimal with no external runtime dependencies. It is designed for local development and requires a running DynamoDB instance. The release cadence is low; the latest version is stable but not actively maintained.

npm install dynamodb-migrate
INSTALL
IMPORT
SIG · DYNAMODB-MIGRATE
D
dynamodb-migrate
databasejavascriptv1.0.2
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.

migrate
const { migrate } = require('dynamodb-migrate');
const migrate = require('dynamodb-migrate').migrate;
The default export is an object with a migrate method. ESM import: import { migrate } from 'dynamodb-migrate';
dynmigrate (default)
const dynmigrate = require('dynamodb-migrate');
import dynmigrate from 'dynamodb-migrate';
CommonJS default import. The package does not ship ESM modules.
TypeScript types
No types included.
import { MigrateOptions } from 'dynamodb-migrate';
This package does not include TypeScript type definitions. Use @types/dynamodb-migrate if available, or declare your own.

Shows how to run DynamoDB migrations using the default endpoint and migrations folder.

const dynmigrate = require('dynamodb-migrate'); const { migrate } = dynmigrate; // Ensure AWS_DYNAMODB_ENDPOINT is set, e.g., 'http://localhost:8000' process.env.AWS_DYNAMODB_ENDPOINT = process.env.AWS_DYNAMODB_ENDPOINT || 'http://localhost:8000'; // Run migrations from './dynamo-migrations' folder migrate() .then(() => console.log('Migrations complete')) .catch(err => console.error('Migration failed:', err));
Debug
Known issues
gotchaThe package requires the environment variable AWS_DYNAMODB_ENDPOINT. If not set, the DynamoDB operations may fail or connect to AWS production.
fix
Set process.env.AWS_DYNAMODB_ENDPOINT to your DynamoDB endpoint, e.g., 'http://localhost:8000' for local development.
affects: all
gotchaMigrations must be placed in a folder named 'dynamo-migrations' in the project root. The package does not allow custom paths.
fix
Ensure your migrations are in './dynamo-migrations' or create a symbolic link.
affects: all
deprecatedThe package does not support ESM imports; only CommonJS require is supported.
fix
Use require() instead of import. Or wrap the import in a dynamic import: const dynmigrate = await import('dynamodb-migrate'); (may have issues).
affects: all
gotchaThe package does not handle concurrent migration runs. Running migrate() twice may apply the same migrations again if not tracked correctly.
fix
Ensure only one instance of migration runs at a time, or extend the package to track applied migrations in a DynamoDB table.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'dynamodb-migrate'
Package not installed or not in node_modules.
fix
Run: npm install dynamodb-migrate
TypeError: dynmigrate.migrate is not a function
Incorrect import or require pattern.
fix
Use: const dynmigrate = require('dynamodb-migrate'); then dynmigrate.migrate();
Error: Environment variable AWS_DYNAMODB_ENDPOINT not set
Package requires this variable to know which DynamoDB instance to connect to.
fix
Set process.env.AWS_DYNAMODB_ENDPOINT before calling migrate(), e.g., process.env.AWS_DYNAMODB_ENDPOINT = 'http://localhost:8000';
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
10
Amazon
1
Resources
dynamodb-migrate — npm install dynamodb-migrate · libregistry