{"id":19755330,"url":"https://github.com/awkward/simple-dyno","last_synced_at":"2025-06-10T15:04:13.775Z","repository":{"id":57360031,"uuid":"42242784","full_name":"awkward/simple-dyno","owner":"awkward","description":"ORM for AWS DynamoDB","archived":false,"fork":false,"pushed_at":"2017-11-20T16:28:06.000Z","size":564,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-06-01T19:18:50.407Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/awkward.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-10T12:21:34.000Z","updated_at":"2021-11-29T09:47:56.000Z","dependencies_parsed_at":"2022-09-06T22:23:14.233Z","dependency_job_id":null,"html_url":"https://github.com/awkward/simple-dyno","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awkward%2Fsimple-dyno","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awkward%2Fsimple-dyno/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awkward%2Fsimple-dyno/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awkward%2Fsimple-dyno/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/awkward","download_url":"https://codeload.github.com/awkward/simple-dyno/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/awkward%2Fsimple-dyno/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259097752,"owners_count":22804775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T03:10:24.762Z","updated_at":"2025-06-10T15:04:13.750Z","avatar_url":"https://github.com/awkward.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# simple-dyno\n\n[![Build Status](https://travis-ci.org/awkward/simple-dyno.svg?branch=master)](https://travis-ci.org/awkward/simple-dyno)\n\nEasy to use, minimalistic wrapper for [AWS DynamoDB](https://aws.amazon.com/dynamodb/)\n\n## Installation\n```bash\n$ npm install @awkward/simple-dyno\n```\n\nPlease also include `require('babel-polyfill')` in your project for node \u003c= 4.0\n\n## Features\n\n* Easy way to create a model, keeping your code consistent and saving it to DynamoDB\n* Serializers to format your (json) response\n* Validation based on [Joi](https://github.com/hapijs/joi)\n* Encryption using [bcrypt](https://github.com/ncb000gt/node.bcrypt.js) for your passwords\n* Local DynamoDB for testing purposes\n\n## Methods\nTo create a new entry, and options can include `{skipValidation: true}`:\n\n    Model.create(attributes, options)\n\nTo get an entry or multiple entries:\n\n    Model.get(keyValues)\n\nTo update an entry, and options can include `{skipValidation: true}`:\n\n    Model.update(keyValues, attributes, options)\n\nTo delete an entry:\n\n    Model.destroy(keyValues)\n\nTo perform a scan operation (not recommended):\n\n    Model.find(attributes)\n\nTo query using a secondary index:\n\n    Model.query(indexName, attributes)\n\nTo serialize the response attributes:\n\n    Model.serialize(response, options)\n\nTo run a local DynamoDB (which runs on Java), by default runs in memory but you can also store on disk using `{inMemory: false}` as options:\n\n    SimpleDyno.local(options)\n\nTo set the config, which you can pass the following options `{accessKeyId: '', secretAccessKey: '', region: ''}`:\n\n    SimpleDyno.config(options)\n\n## Example (in this case the config is set by default by AWS and assumes tables are already created)\n```javascript\n// Import deps\nimport { Model } from 'simple-dyno';\nimport Joi from 'joi';\n\n// Add your own methods\nclass UserModel extends Model {\n  myAwesomeMethod(obj) {\n    return obj.firstName+obj.lastName;\n  }\n}\n\n// Create model instance\nvar User = new UserModel({\n  table: 'users',\n  hashKey: 'email',\n  serializers: {\n    default: ['email'],\n    scary: ['access_token', 'password']\n  },\n  schema: {\n    email: Joi.string().email(),\n    access_token: Joi.string(),\n    password: {\n      format: Joi.string().regex(/[a-zA-Z0-9]{3,30}/),\n      encrypt: true\n    }\n  }\n});\n\nvar userObj = yield User.create({email: 'test@simpledyno.com', access_token: 'aW12k3KDASsd012Ms1Mf29Mc7', password: '******'})\nreturn User.serialize(userObj, {format: 'scary'});\n```\n\n## Example of running the local environment\n```javascript\n// Import deps\nimport * as SimpleDyno from 'simple-dyno';\n\n// Start a local DynamoDB\nyield SimpleDyno.local();\n\n// Create accociated tables for the following model(s)\nSimpleDyno.load(User);\n```\n\n## Todo\n\n* Fix CI by allowing Java to run on Travis\n* Migrations\n* Better docs (explain how AWS works)\n\n## How to contribute\n\nPlease create a pull request, make sure to include and update the tests and that they're working. And don't forget to build the minified version (with babel) with `npm run build`.\n\n## Running tests\n\nUse `npm test` to do a test run using Mocha.\n\n## Legal stuff (MIT License)\n\nCopyright (c) 2016 Awkward.\n\nDistributed under MIT license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawkward%2Fsimple-dyno","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fawkward%2Fsimple-dyno","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fawkward%2Fsimple-dyno/lists"}