Registry / database / nodenamo

nodenamo

JSON →
library2.2.0jsnpmunverified

Nodenamo is a lightweight ORM for DynamoDB that simplifies data modeling and querying using decorators. Version 2.2.0 supports ESM, TypeScript types, and provides a fluent API for CRUD operations, transactions, and table management. Unlike low-level SDKs, it abstracts table schema (hash/range keys, GSI) and automatically maps classes to DynamoDB items. Released under MIT, with periodic updates. Requires Node.js 12+ and AWS SDK v3.

npm install nodenamo
INSTALL
IMPORT
SIG · NODENAMO
N
nodenamo
databasejavascriptv2.2.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.

NodeNamo
import { NodeNamo } from 'nodenamo'
const NodeNamo = require('nodenamo')
ESM-only since v2. CommonJS require will fail.
DBTable
import { DBTable } from 'nodenamo'
import DBTable from 'nodenamo'
DBTable is a named export, not default.
DBColumn
import { DBColumn } from 'nodenamo'
import { Column } from 'nodenamo'
Use DBColumn, not Column.

Shows full lifecycle: define a class with decorators, create table, insert, get, list, and delete using NodeNamo's fluent API.

import { NodeNamo, DBTable, DBColumn, ReturnValue } from 'nodenamo'; @DBTable() class User { @DBColumn({ id: true }) id: number; @DBColumn() name: string; @DBColumn() email: string; constructor(id?: number, name?: string, email?: string) { this.id = id; this.name = name; this.email = email; } } const nodenamo = new NodeNamo({ region: 'us-east-1' }); async function main() { await nodenamo.createTable().for(User).execute(); const user = new User(1, 'Some One', 'some.one@example.com'); await nodenamo.insert(user).into(User).execute(); const retrieved = await nodenamo.get(1).from(User).execute<User>(); console.log(retrieved); const all = await nodenamo.list().from(User).execute<User>(); console.log(all.items); await nodenamo.delete(1).from(User).execute(); } main().catch(console.error);
Debug
Known issues
breakingv2.0.0 dropped CommonJS support; ESM imports only.
fix
Use ES module imports (import { ... } from 'nodenamo') and ensure your project is configured for ESM (e.g., type: module in package.json).
affects: >=2.0.0
breakingv2.0.0 replaced AWS SDK v2 with v3; dynamodb client configuration changed.
fix
Use AWS SDK v3 clients: new NodeNamo({ region: '...' }) instead of old v2 config.
affects: >=2.0.0
deprecatedReturnValue.AllOld is deprecated in v2. Use 'ALL_OLD' string instead.
fix
Replace ReturnValue.AllOld with 'ALL_OLD' in update queries.
affects: >=2.0.0
gotchaMust use @DBColumn({ id: true }) on exactly one property; otherwise operations like get() will fail.
fix
Ensure exactly one property has @DBColumn({ id: true }).
affects: >=1.0.0
gotchacreateTable().for() may throw if table already exists (ResourceInUseException).
fix
Catch ResourceInUseException or check existence before creating.
affects: >=1.0.0
Errors
Common errors & fixes
ERR_REQUIRE_ESM: require() of ES Module /path/to/node_modules/nodenamo/index.js not supported.
Using CommonJS require() on an ESM-only package (v2+).
fix
Change to import statement: import { NodeNamo } from 'nodenamo'
TypeError: Cannot read properties of undefined (reading 'from')
Missing @DBColumn({ id: true }) on any property, so get() cannot determine the hash key.
fix
Add @DBColumn({ id: true }) to one property in your class.
ValidationException: One or more parameter values were invalid: Missing required parameter: ExpressionAttributeNames
Incorrect use of update with unsupported options or mismatched class definition.
fix
Ensure using update(obj).from(T).returning('ALL_OLD').execute() format.
Upgrade
Version history
2.2.0latest on npm
Audit
Dependencies
@aws-sdk/client-dynamodbrequiredDynamoDB client for AWS SDK v3
@aws-sdk/lib-dynamodbrequiredDynamoDB document client utilities
Agent activity
4 hits · last 30 days
node
4
Resources
nodenamo — npm install nodenamo · libregistry