Registry / database / npdynamodb

npdynamodb

JSON →
library0.2.15jsnpmunverified

A Node.js Simple Query Builder and ORM for AWS DynamoDB, providing an ActiveRecord-like interface with built-in migration and CLI tools. Current stable version 0.2.15 (last released around 2016). It wraps the low-level AWS SDK v2 DynamoDB client to simplify queries, filters, and CRUD operations. Key differentiators include a query builder that avoids verbose AWS parameter objects, a light ORM with Active Record patterns, and a migration system. Released quarterly, but no recent updates in years.

npm install npdynamodb
INSTALL
IMPORT
SIG · NPDYNAMODB
N
npdynamodb
databasejavascriptv0.2.15
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.

npdynamodb
const npdynamodb = require('npdynamodb');
import npdynamodb from 'npdynamodb';
Only CommonJS module, no ESM support. Default export is a function.
createClient
const client = npdynamodb.createClient(dynamodb);
const client = new npdynamodb.Client(dynamodb);
createClient is a static method on the default export.
Schema
const Schema = npdynamodb.Schema;
import { Schema } from 'npdynamodb';
Schema is a property on the default export.

Initialize npdynamodb client, perform a getItem by hash key, and a query with range key filter and descending order.

const npdynamodb = require('npdynamodb'); const AWS = require('aws-sdk'); const dynamodb = new AWS.DynamoDB({ apiVersion: '2012-08-10', region: process.env.AWS_REGION ?? 'us-east-1' }); const npd = npdynamodb.createClient(dynamodb); // Get a single item by primary key npd().table('users') .where('id', 1) .first() .then(data => console.log(data)) .catch(err => console.error(err)); // Query with filter and descending order npd().table('chats') .where('room_id', 'room1') .where('timestamp', '>', 1429454911) .filter('user_name', 'tonny') .desc() .then(data => console.log(data)) .catch(err => console.error(err));
Debug
Known issues
deprecatedPackage has not been updated since 2016 and relies on old AWS SDK v2. No longer maintained.
fix
Migrate to AWS SDK v3 and use DocumentClient or alternatives like dynamoose, dynamodb-datamodel.
affects: *
breakingRequires AWS SDK v2 specifically; incompatible with AWS SDK v3 (v3 uses modular packages).
fix
Install aws-sdk v2, not @aws-sdk/client-dynamodb.
affects: >=0.1.0
gotchaThe top-level default export is a function; calling npdynamodb() returns a builder instance. Common misuse: treating it as a constructor.
fix
Use const npd = npdynamodb.createClient(dynamodb); then call npd() to start a query.
affects: *
gotchaQueryBuilder first() uses getItem operation, which requires full primary key (hash + range if table has range key). Missing range key throws validation error.
fix
Ensure you chain .where() for both hash and range key before first().
affects: *
Errors
Common errors & fixes
Cannot find module 'aws-sdk'
aws-sdk not installed or not compatible with SDK v3
fix
npm install aws-sdk@2
TypeError: npd().table is not a function
npdynamodb default export not called correctly; missing createClient
fix
const npd = npdynamodb.createClient(dynamodb); then npd().table('users')
ValidationException: The provided key element does not match the schema
Missing required key attributes in where clauses for getItem/update/delete
fix
Ensure all key attributes (hash and range) are provided via .where()
Upgrade
Version history
0.2.15latest on npm
Audit
Dependencies
aws-sdkrequiredUses AWS DynamoDB client for all operations
Agent activity
2 hits · last 30 days
node
2
Resources
npdynamodb — npm install npdynamodb · libregistry