dynamodb-json-schema
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

dynamodb-json-schema Build Status

Generate dynamodb table schema from json schema

Example Usage

import * as fs from "fs";
import { getTableSchema } from "dynamodb-json-schema";
 
const USER_SCHEMA = JSON.parse(fs.readFileSync("User.json", "utf8"));
 
const tableSchema = getTableSchema({
  tableName: "users-table",
  hashKey: "id",
  itemSchema: USER_SCHEMA
});
 
/*
=> {
  "TableName": "users-table",
  "KeySchema": [{
    "AttributeName": "id",
    "AttributeType": "HASH"
  }],
  "AttributeDefinitions": [{
    "AttributeName": "id",
    "AttributeType": "S"
  }]
}
*/

Readme

Keywords

none

Package Sidebar

Install

npm i dynamodb-json-schema

Weekly Downloads

1

Version

0.1.2

License

MIT

Unpacked Size

210 kB

Total Files

25

Last publish

Collaborators

  • charleskenney