aws-cdk-dynamodb-seeder
Advanced tools
Comparing version 1.0.0 to 1.1.0
{ | ||
"name": "aws-cdk-dynamodb-seeder", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "A simple CDK JSON seeder for DynamoDB", | ||
@@ -17,4 +17,4 @@ "scripts": { | ||
}, | ||
"main": "lib/seeder.js", | ||
"types": "lib/seeder.d.ts", | ||
"main": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"repository": { | ||
@@ -29,3 +29,3 @@ "type": "git", | ||
"seed", | ||
"json" | ||
"seeder" | ||
], | ||
@@ -32,0 +32,0 @@ "author": "Justin Taylor <jtaylor@elegantdevelopment.co.uk> (https://www.linkedin.com/in/jsdtaylor)", |
# aws-cdk-dynamodb-seeder | ||
![Node.js CI](https://github.com/elegantdevelopment/aws-cdk-dynamodb-seeder/workflows/Node.js%20CI/badge.svg) | ||
[![npm version](https://badge.fury.io/js/aws-cdk-dynamodb-seeder.svg)](https://badge.fury.io/js/aws-cdk-dynamodb-seeder) | ||
![npm](https://img.shields.io/npm/dt/aws-cdk-dynamodb-seeder) | ||
@@ -17,11 +19,23 @@ A simple CDK JSON seeder for DynamoDB | ||
Install using your favourite package manager: | ||
```sh | ||
yarn add aws-cdk-dynamodb-seeder | ||
``` | ||
### Example usage | ||
```ts | ||
new Seeder(stack, 'MySeeder', { | ||
table: new Table(stack, 'MyTable', { | ||
tableName: 'MyTable', | ||
partitionKey: { name: 'Id', type: AttributeType.STRING }, | ||
}), | ||
tableName: "TestTable", | ||
json: require("./my-seed-data.json") | ||
import { Seeder } from 'aws-cdk-dynamodb-seeder'; | ||
... | ||
const myTable = new Table(stack, "MyTable", { | ||
tableName: "MyTable", | ||
partitionKey: { name: "Id", type: AttributeType.STRING }, | ||
}); | ||
... | ||
new Seeder(stack, "MySeeder", { | ||
table: myTable, | ||
tableName: "MyTable", | ||
setup: require("./my-seed-data.json") | ||
}); | ||
``` | ||
@@ -31,7 +45,6 @@ | ||
Seed data is imported via a JSON file and can either be a single object or an array of objects. | ||
Seed data is imported/deleted via an arrays of objects. | ||
Just remember that the objects _must_ match your table's key definitions. | ||
Just remember that the objects *must* match your table's key definitions. | ||
[AWS CDK]: https://aws.amazon.com/cdk | ||
[Amazon DynamoDB]: https://aws.amazon.com/dynamodb | ||
[aws cdk]: https://aws.amazon.com/cdk | ||
[amazon dynamodb]: https://aws.amazon.com/dynamodb |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17482
5
75
49