dynamodb-value

1.0.5 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i dynamodb-value

Weekly Downloads

67

Version

1.0.5

License

MIT

Last publish

Collaborators

  • it-ironsrc
  • kessler