Registry / database / dynamize

dynamize

JSON →
library1.2.2jsnpmunverified

Dynamize is a promise-based Node.js ORM for Amazon DynamoDB inspired by Sequelize, offering an object-relational mapping layer for managing DynamoDB tables and items. Current stable version is 1.2.2, with infrequent releases and no active development since 2020. It provides schema definition, CRUD operations, query building, and transaction support, but is not recommended for new projects due to lack of TypeScript support and maintenance inactivity. Compared to alternatives like Dynamoose or @aws/dynamodb-data-mapper, Dynamize has a simpler API but lacks advanced features and community support.

npm install dynamize
INSTALL
IMPORT
SIG · DYNAMIZE
D
dynamize
databasejavascriptv1.2.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.

default export (dynamize)
const dynamize = require('dynamize');
Library does not support ES module imports; use CommonJS require.
Schema definition
const { Schema } = require('dynamize');
Schema is a named export, not a property of the default export.
Types
const dynamize = require('dynamize'); // No separate type imports; use JSDoc or rely on runtime
No TypeScript types available; use JavaScript.

Connects to DynamoDB, defines a User model, and creates a new item.

const dynamize = require('dynamize'); const config = { region: 'us-east-1', accessKeyId: process.env.AWS_ACCESS_KEY_ID, secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY }; dynamize.connect(config); const User = dynamize.define('User', { id: { type: String, key: 'hash' }, email: { type: String }, age: { type: Number } }); const user = new User({ id: '1', email: 'test@example.com', age: 30 }); user.save() .then(() => console.log('User saved!')) .catch(err => console.error(err));
Debug
Known issues
gotchaIdempotent operations: save() will overwrite existing items if the hash key matches.
fix
Use update() or explicitly check if item exists before save().
affects: >=1.0.0
gotchaPromise-based: all methods return Bluebird promises; avoid mixing with native promises.
fix
Use .then()/.catch() or async/await with bluebird.config({ cancellation: true }) to avoid unhandled rejections.
affects: >=1.0.0
deprecatedLibrary has not been updated since 2020; no support for DynamoDB features like TTL, Streams, or Global Tables.
fix
Consider migrating to an actively maintained library like Dynamoose or the AWS SDK v3 DynamoDB DocumentClient.
affects: >=1.2.2
gotchaError messages may be obscure due to internal promise handling.
fix
Add .catch() handlers and inspect Bluebird stack traces.
affects: >=1.0.0
gotchaRequires aws-sdk v2; not compatible with v3.
fix
Ensure you have aws-sdk v2 installed (npm install aws-sdk@2).
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'dynamize'
Package not installed or node_modules missing.
fix
Run 'npm install dynamize' or 'yarn add dynamize'.
TypeError: dynamize.connect is not a function
Incorrect default import; library uses CommonJS.
fix
Use const dynamize = require('dynamize'); not import dynamize from 'dynamize';
Unhandled rejection Error: ValidationError: User.email is required
Missing required field on save.
fix
Ensure all schema-defined required fields are set before calling save().
Unhandled rejection Error: ProvisionedThroughputExceededException
Exceeded DynamoDB table throughput limits.
fix
Increase read/write capacity or implement retry logic.
TypeError: Cannot read property 'hash' of undefined
Schema missing key definition.
fix
Add { key: 'hash' } to the primary key field in the schema.
Upgrade
Version history
1.2.2latest on npm
Audit
Dependencies
aws-sdkrequiredRequired for DynamoDB client operations and authentication.
bluebirdrequiredUsed for promise management and performance.
Agent activity
7 hits · last 30 days
node
6
Resources
dynamize — npm install dynamize · libregistry