1.0.5 • Published 7 years ago

dynamify-json-object v1.0.5

Weekly downloads
29
License
MIT
Repository
github
Last release
7 years ago

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                        |
1.0.5

7 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago