1 | # Dynamoose
|
2 |
|
3 | [![Slack Chat](https://img.shields.io/badge/chat-on%20slack-informational.svg)](https://publicslack.com/slacks/dynamoose/invites/new) [![Build Status](https://travis-ci.org/dynamoosejs/dynamoose.svg)](https://travis-ci.org/dynamoosejs/dynamoose) [![Coverage Status](https://coveralls.io/repos/github/dynamoosejs/dynamoose/badge.svg?branch=master)](https://coveralls.io/github/dynamoosejs/dynamoose?branch=master)
|
4 |
|
5 | Dynamoose is a modeling tool for Amazon's DynamoDB (inspired by [Mongoose](http://mongoosejs.com/))
|
6 |
|
7 |
|
8 | ## Getting Started
|
9 |
|
10 | ### Installation
|
11 |
|
12 | $ npm i dynamoose
|
13 |
|
14 | ### Example
|
15 |
|
16 | Set AWS configurations in environment variables:
|
17 |
|
18 | ```sh
|
19 | export AWS_ACCESS_KEY_ID="Your AWS Access Key ID"
|
20 | export AWS_SECRET_ACCESS_KEY="Your AWS Secret Access Key"
|
21 | export AWS_REGION="us-east-1"
|
22 | ```
|
23 |
|
24 | Here's a simple example:
|
25 |
|
26 | ```js
|
27 | const dynamoose = require('dynamoose');
|
28 |
|
29 | // Create cat model with default options
|
30 | const Cat = dynamoose.model('Cat', {
|
31 | id: Number,
|
32 | name: String
|
33 | });
|
34 |
|
35 | // Create a new cat object
|
36 | const garfield = new Cat({
|
37 | id: 666,
|
38 | name: 'Garfield'
|
39 | });
|
40 |
|
41 | // Save to DynamoDB
|
42 | garfield.save(); // Returns a promise that resolves when save has completed
|
43 |
|
44 | // Lookup in DynamoDB
|
45 | Cat.get(666).then((badCat) => {
|
46 | console.log(`Never trust a smiling cat. - ${badCat.name}`);
|
47 | });
|
48 | ```
|
49 |
|
50 | ## API Docs
|
51 |
|
52 | The documentation can be found at https://dynamoosejs.com/api/about/. You can also find additional examples at https://dynamoosejs.com/examples/about/.
|
53 |
|
54 | ## Changelog
|
55 |
|
56 | The Dynamoose Changelog can be found in the [CHANGELOG.md](//github.com/dynamoosejs/dynamoose/blob/master/CHANGELOG.md) file.
|
57 |
|
58 | ## Roadmap
|
59 |
|
60 | The Dynamoose Roadmap can be found in the [ROADMAP.md](//github.com/dynamoosejs/dynamoose/blob/master/ROADMAP.md) file. Help is always appreciated on these items. If you are able to help submit a PR so we can review and improve Dynamoose!
|
61 |
|
62 | ## Contributing
|
63 |
|
64 | To contirubute to this project please checkout our [CONTRIBUTING.md](//github.com/dynamoosejs/dynamoose/blob/master/CONTRIBUTING.md) file.
|