UNPKG

2.01 kBMarkdownView Raw
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
5Dynamoose 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
16Set AWS configurations in environment variables:
17
18```sh
19export AWS_ACCESS_KEY_ID="Your AWS Access Key ID"
20export AWS_SECRET_ACCESS_KEY="Your AWS Secret Access Key"
21export AWS_REGION="us-east-1"
22```
23
24Here's a simple example:
25
26```js
27const dynamoose = require('dynamoose');
28
29// Create cat model with default options
30const Cat = dynamoose.model('Cat', {
31 id: Number,
32 name: String
33});
34
35// Create a new cat object
36const garfield = new Cat({
37 id: 666,
38 name: 'Garfield'
39});
40
41// Save to DynamoDB
42garfield.save(); // Returns a promise that resolves when save has completed
43
44// Lookup in DynamoDB
45Cat.get(666).then((badCat) => {
46 console.log(`Never trust a smiling cat. - ${badCat.name}`);
47});
48```
49
50## API Docs
51
52The 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
56The Dynamoose Changelog can be found in the [CHANGELOG.md](//github.com/dynamoosejs/dynamoose/blob/master/CHANGELOG.md) file.
57
58## Roadmap
59
60The 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
64To contirubute to this project please checkout our [CONTRIBUTING.md](//github.com/dynamoosejs/dynamoose/blob/master/CONTRIBUTING.md) file.