https://github.com/labd/node-dynamodb-mock
https://github.com/labd/node-dynamodb-mock
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/labd/node-dynamodb-mock
- Owner: labd
- License: mit
- Created: 2023-08-08T09:38:14.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-09T05:49:42.000Z (almost 3 years ago)
- Last Synced: 2024-12-31T19:29:57.248Z (over 1 year ago)
- Language: TypeScript
- Size: 191 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# DynamoDB Mock
This is a relatively simple wrapper around
[dynalite](https://github.com/mhart/dynalite) to make it easier to use in a test
environment.
[](https://www.npmjs.com/package/@labdigital/mock-dynamodb)
## Usage
```typescript
import { mockDynamoDB } from "@labdigital/mock-dynamodb";
const mddb = mockDynamoDB({ endpoint: "http://localhost:4000" });
const client = new DynamoDB({
endpoint: "http://localhost:4000",
region: "local",
credentials: {
accessKeyId: "fake-x",
secretAccessKey: "fake",
},
});
mddb.reset(); // Clear all data
mddb.stop(); // Stop the server
```