{"id":2456171,"url":"https://github.com/giladno/dynamodb","last_synced_at":"2025-07-23T08:32:09.480Z","repository":{"id":57113332,"uuid":"165389565","full_name":"giladno/dynamodb","owner":"giladno","description":"Simple DynamoDB wrapper for Node.js","archived":false,"fork":false,"pushed_at":"2019-01-18T22:44:37.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2024-04-25T21:22:50.245Z","etag":null,"topics":["amazon-dynamodb","dynamodb","javascript"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/giladno.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":"2019-01-12T13:16:02.000Z","updated_at":"2021-03-11T23:18:17.000Z","dependencies_parsed_at":"2022-08-22T02:50:19.622Z","dependency_job_id":null,"html_url":"https://github.com/giladno/dynamodb","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/giladno%2Fdynamodb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giladno%2Fdynamodb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giladno%2Fdynamodb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giladno%2Fdynamodb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/giladno","download_url":"https://codeload.github.com/giladno/dynamodb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227256954,"owners_count":17754627,"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":["amazon-dynamodb","dynamodb","javascript"],"created_at":"2024-01-24T16:47:49.270Z","updated_at":"2024-11-30T02:30:52.209Z","avatar_url":"https://github.com/giladno.png","language":"JavaScript","funding_links":[],"categories":["Projects by main language"],"sub_categories":["Old Projects"],"readme":"# dynamodb\n\nSimple DynamoDB wrapper for Node.js\n\n\u003e Note: This is still under active development\n\n## Installation\n\nRequires Node.js 8.6.0+.\n\n```\n$ npm install @giladno/dynamodb --save\n```\n\n## Usage\n\n```js\nconst dynamodb = require('@giladno/dynamodb');\nconst {User} = dynamodb();\n\nUser.define({\n    attributes: {username: {type: 'S'}},\n    throughput: 5,\n});\n\nawait User.put({username: 'bob', age: 42});\nawait User.put({username: 'alice', age: 38});\n\nconsole.log(await User.scan());\n```\n\n## API\n\n#### dynamodb([options])\n\nCreates a database instance\n\n-   `options`\n    -   `AWS` AWS sdk to use. Defaults to `require('aws-sdk')`.\n    -   `waitForActive` How long to wait for an `ACTIVE` state when creating a new table. Defaults to `180000` (3 minutes). Use `0` to disable waiting and `-1` to wait indefinitely.\n-   returns: a database instance\n\n#### database\n\nThe database instance will automatically create a table instance simply by accessing it:\n\n```js\ndb.User.get(...);\ndb.Post.put(...);\n```\n\n\u003e Names are case-sensitive. `db.user` and `db.User` will create **different** table names!\n\n#### table.define(schema)\n\nDefines a schema for that table\n\n-   `schema`\n    -   `attributes` An object representing attributes/keys for table creation\n        -   `type` DynamoDB type (`S`, `N`, `B`)\n        -   `range` Set to `true` for `RANGE` key type (default to `HASH` type)\n    -   `throughput` Provisioned throughput. Can use a single number for both read/write capacity or an object with `read`/`write` keys. When `throughput` is not defined, this will set billing mode to `PAY_PER_REQUEST`.\n        \u003e `PAY_PER_REQUEST` is not supported when testing locally using **dynamodb-local**\n    -   `kms` Optional KMS master key to use.\n\n\u003e This method is only required if you want to allow the database to create tables implicitly when required. It is not required if you create them yourself (using the CLI/CloudFormation or by calling `table.init`).\n\n#### table.init(schema)\n\nCreates a table in DynamoDB\n\n-   `schema` Same as [table.define](#table.define)\n\n\u003e This method will be called automatically when trying to access a table which does not exist.\n\n#### table.scan()\n\nReturns all items in the table\n\n#### table.get(key, [options])\n\nFinds a single item by key\n\n#### table.put(data, [options])\n\nCreate/update a single item\n\n#### table.update(key, data, [options])\n\nUpdates a single item\n\n#### table.delete(data, [options])\n\nDeletes a single item\n\n#### table.destroy([options])\n\nDeletes the table\n\n## TODO\n\n-   [ ] Finish documentation\n-   [ ] Add query/filter/projection support\n\n## Contributing\n\nPR's are more than welcome! You can also drop me a line at gilad@novik.ca\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiladno%2Fdynamodb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiladno%2Fdynamodb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiladno%2Fdynamodb/lists"}