Skip to content
This repository was archived by the owner on Oct 17, 2021. It is now read-only.

ironSource/node-dynamodb-value

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dynamodb-value Build Status

Convert javascript object into dynamodb schema and back. This is a simplified version of a more complete solution: official sdk from aws

This module does not support data types that are not native to javascript

    var DynamoDBValue = require('dynamodb-value')
    
    var jsObj = {
        str: '1439057466535',
        num: 123,
        obj: { z: '1' },
        list: ['123', { b: '2' }]
    }

    var ddbObject = {
        str: { S: '1439057466535' },
        num: { N: '123' },
        obj: {M: { z: { S: '1' }}},
        list: { L: [ { S: '123' }, { M: { b: { S: '2' }}}] }
    }

    DynamoDBValue.toJavascript(ddbObject) // deeply equal jsObj
    DynamoDBValue.toDDB(jsObj) // deeply equal ddbObject

MIT © ironSource

About

convert js objects into dynamodb schema objects and back

Resources

License

Stars

Watchers

Forks

Packages

No packages published