Socket
Socket
Sign inDemoInstall

dynamo-helpers

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

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
5
increased by400%
Maintainers
1
Install size
5.29 kB
Created
Weekly downloads
 

Readme

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

Last updated on 04 Jul 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc