npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dynamo-rest-wrapper-optimizer

v1.0.4

Published

A DynamoDB REST Wrapper & Optimizer for NodeJS

Readme

dynamo-rest-wrapper-optimizer

Dynamo REST Wrapper & Optimizer

This module attempts to simplify the interaction between a NodeJS application and DynamoDB using a RESTful protocol.

The need for this package came from the lack of libraries out there to simply create a REST API.

It exposes the common functions GET, POST, PUT & DELETE

It is simple in design, as it does not do any validation, leaving it up to the implementation.

Side Note: This was created to be used in combination with other AWS Services. (API Gateway & Lambda Functions)

**Limitation: This module only supports Dynamo tables that use a HASH Key only. HASH-RANGE Keys are not supported.

Requirements

Node 7.6 & Higher

Installation

npm install dynamo-rest-wrapper-optimizer

Usage

async/await

const AWS = require('aws-sdk');
const dynamoRestHelper = require('dynamo-rest-wrapper-optimizer');
const dynamoConnection = new AWS.DynamoDB();

var myTableName = "MyTableName";
var myQuery = {"firstName":"John"};
var queryLimit = 1;
//var offsetKey = "{{OFFSETKEY_HERE}}"

var {err, result} = await dynamoRestHelper.get(dynamoConnection, myTableName, myQuery, queryLimit, offsetKey);

Quick Examples

GET

Non-Primary Key Query Returns Array of results

var {err, result} = await dynamoRestHelper.get(dynamoConnection, "Users", {"firstName":"John"}, 2);

if(err){
    //Something went wrong...
    console.log(err);
}
console.log(result);
/*
Will output:
{
    "data":[
        {"firstName":"John","lastName":"Doe","age": 59,"email":"[email protected]","userId":"abb7bd05-aaaf-49e7-b5a7-e2953342f17d"},
        {"firstName":"John","lastName":"Smith","age": 21,"email":"[email protected]","userId":"756d1605-5686-4ac0-af23-c03d41acd3d6"}
    ],
    "LastEvaluatedKey":"eyJleHBlcmltZW50SWQiOnsiUyI6ImFiYjdiZDA1LWFhYWYtNDllNy1iNWE3LWUyOTUzMzQyZjE3ZCJ9fQ=="
}
*/

Primary Key Query Returns Single result

var {err, result} = await dynamoRestHelper.get(dynamoConnection, "Users", {"userId":"abb7bd05-aaaf-49e7-b5a7-e2953342f17d"});

if(err){
    //Something went wrong...
    console.log(err);
}
console.log(result);
/*
Will output:
{
    "data":{"firstName":"John","lastName":"Doe","age": 59,"email":"[email protected]","userId":"abb7bd05-aaaf-49e7-b5a7-e2953342f17d"}
}
*/

POST

Insert New Record Returns Single result

SideNote: Specifying Primary key is not necessary. A UUID4 will be generated

var {err, result} = await dynamoRestHelper.post(dynamoConnection, "Users", {"firstName":"Eric", "lastName":"Smith", "age":15});

if(err){
    //Something went wrong...
    console.log(err);
}
console.log(result);
/*
Will output:
{
    "data":{"userId":"ae52de04-e897-425d-beaa-078d72a4ecf5","firstName":"Eric", "lastName":"Smith", "age":15}
}
*/

PUT

Updates an Existing Record Returns Single result

SideNote: Specifying Primary key is required. If not, will throw error

var {err, result} = await dynamoRestHelper.put(dynamoConnection, "Users", {"userId":"ae52de04-e897-425d-beaa-078d72a4ecf5", "age": 16});

if(err){
    //Something went wrong...
    console.log(err);
}
console.log(result);
/*
Will output:
{
    "data":{"userId":"ae52de04-e897-425d-beaa-078d72a4ecf5","firstName":"Eric", "lastName":"Smith", "age":16}
}
*/

DELETE

Delete an Existing Record Returns 'true' if successful

SideNote: Specifying Primary key is required. If not, will throw error (Will also throw error if a non-existant key is specified)

var {err, result} = await dynamoRestHelper.delete(dynamoConnection, "Users", {"userId":"ae52de04-e897-425d-beaa-078d72a4ecf5"});

if(err){
    //Something went wrong...
    console.log(err);
}
console.log(result);
/*
Will output:
true
*/