1.0.5 • Published 8 years ago

dynamodb-value v1.0.5

Weekly downloads
85
License
MIT
Repository
github
Last release
8 years ago

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