Socket
Book a DemoInstallSign in
Socket

dynamodb-types

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dynamodb-types

easiest way to convert your JSON to dynamo db types format

1.0.4
latest
npmnpm
Version published
Maintainers
1
Created
Source

DynamoDB Types

Converts JSON Object to DynamoDB Required JSON Object format.

NPM Version Build Status Downloads Stats

An easy way to convert your JSON data to DynamoDB required format, basically it just converts the value to { [data-type-key]: value } format, and it supports nested JSON data.

Installation

npm install --save dynamodb-types

Usage example


let DynamoTypes = require('dynamodb-types')

DynamoTypes.parse({
  id: 1,
  name: 'John Doe',
  age: 16
})
//  The code above would convert the JSON Object to:
//  {
//    id: {
//      N: 1
//    },
//    name: {
//      S: 'John Doe'
//    },
//    age: {
//      N: 16
//    }
//  }

// You can also use the DynamoTypes.parseUpdate to generate an AttributeValueUpdate Format
// Example:
DynamoTypes.parseUpdate
  .add({ name: 'John Doe' })
  .put({ age: 12 })
  .delete('postal_id')
  .getValue()

//  The code above would convert the JSON Object to:
// {  
//    "name":{  
//       "Action":"ADD",
//       "Value":{  
//          "S":"John Doe"
//       }
//    },
//    "age":{  
//       "Action":"PUT",
//       "Value":{  
//          "N":12
//       }
//    },
//    "postal_id":{  
//       "Action":"DELETE"
//    }
// }

Development setup

You can clone the Github repository and run the following npm command.

npm install

Release History

  • 1.0.3
    • fixed issue with list
    • Corrected Backward compatibility errors
  • 1.0.0
    • Initial Release

Contributor

Jacob Baring – @yakovmeisterso@tfwno.gf

Distributed under the MIT license. See LICENSE for more information.

https://github.com/yakovmeister/

Contributing

  • Fork it (https://github.com/yakovmeister/dynamodb-types/fork)
  • Create your feature branch (git checkout -b feature/fooBar)
  • Commit your changes (git commit -am 'Add some fooBar')
  • Push to the branch (git push origin feature/fooBar)
  • Create a new Pull Request

Keywords

dynamo

FAQs

Package last updated on 29 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.