Skip to content

Javascript library that converts standard json object to AWS's dynamodb marshalled object.

License

Notifications You must be signed in to change notification settings

bychwa/dynamify-json-object

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dynamify-Json-Object

Since Dynamodb uses a rather cumbersome json format to define its data, dynamify-json-object is a simple helper library that will help you convert your standard json object into DynamoDB accepted format. This will help you continue working with json format that you are already used to rather than worrying about dynamodb specific json convention.

Installation

Install this library as a dependency with npm tool.

$ npm install dynamify-json-object --save

Usage:

To use the library, use the following code to require and call dynamifyObject function.

const helper = require('dynamify-json-object');

helper.dynamifyObject({'name' :'Jackson','age':20,'enabled':true}, function(data){
    console.log(data);
});

Output:

{"name" : {"S":"Jackson"}, "age" : {"N":20}, "enabled" : {"B":true}}

Supported types:

| JavaScript types                                                       | DynamoDB Attribute Value |
|------------------------------------------------------------------------|--------------------------|
| String                                                                 | S                        |
| Number                                                                 | N                        |
| Boolean                                                                | BOOL                     |
| null                                                                   | NULL                     |
| Array                                                                  | L                        |
| Object                                                                 | M                        |
| Buffer, File, Blob, ArrayBuffer, DataView, and JavaScript typed arrays | B                        |

About

Javascript library that converts standard json object to AWS's dynamodb marshalled object.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published