Socket
Socket
Sign inDemoInstall

dynamo-helpers

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dynamo-helpers

a helper library to make a standard object valid for insertion into dynamodb, and to turn the item from dynamodb back into the format of the inserted object


Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

dynamo-helpers

npm install dynamo-helpers

a simple helper library that takes a standard JS object, and turns it into an object that can be inserted into dynamodb and turns an object from dynamodb back into a standard JS object.

Example

objectToDynamo

var dynamoHelpers = require("dyanmo-helpers");

var object = {
	cool: "teen",
	wow: 2,
	conor: ["really", "cool", "guy"],
	numbers: [1, 2, 3]
};

var dynamoObject = dynamoHelpers.objectToDynamo(object); 
/* returns
* {
*	cool: {"S": "teen"},
*	wow: {"N": 2},
*	conor: {SS: ["really", "cool", "guy"]},
*	numbers: {NS: [1, 2, 3]}
* }
*/

dynamoToObject

var dynamoHelpers = require("object2dynamo");

var dynamoObject = {
	cool: {"S": "teen"},
	wow: {"N": 2},
	conor: {SS: ["really", "cool", "guy"]},
	numbers: {NS: [1, 2, 3]}
 };

var object = dynamoHelpers.dynamoToObject(dynamoObject);

/* returns 
* {
*	cool: "teen",
*	wow: 2,
*	conor: ["really", "cool", "guy"],
*	numbers: [1, 2, 3]
* }
*/

Test

npm test to run tests.

Keywords

FAQs

Package last updated on 29 Jun 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc