{"id":28795607,"url":"https://github.com/bakerface/fluent-dynamo","last_synced_at":"2025-10-29T20:09:47.986Z","repository":{"id":27396781,"uuid":"30873126","full_name":"bakerface/fluent-dynamo","owner":"bakerface","description":"A fluent interface for Amazon DynamoDB in Node.js","archived":false,"fork":false,"pushed_at":"2015-11-24T22:38:33.000Z","size":31,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-29T21:42:12.270Z","etag":null,"topics":[],"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/bakerface.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-02-16T15:00:54.000Z","updated_at":"2020-05-11T12:49:02.000Z","dependencies_parsed_at":"2022-09-05T08:21:35.097Z","dependency_job_id":null,"html_url":"https://github.com/bakerface/fluent-dynamo","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/bakerface/fluent-dynamo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bakerface%2Ffluent-dynamo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bakerface%2Ffluent-dynamo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bakerface%2Ffluent-dynamo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bakerface%2Ffluent-dynamo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bakerface","download_url":"https://codeload.github.com/bakerface/fluent-dynamo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bakerface%2Ffluent-dynamo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269809476,"owners_count":24478545,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-06-18T03:09:34.310Z","updated_at":"2025-10-29T20:09:42.954Z","avatar_url":"https://github.com/bakerface.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fluent-dynamo\n**A fluent interface for Amazon DynamoDB in Node.js**\n\n[![npm version](https://badge.fury.io/js/fluent-dynamo.svg)](http://badge.fury.io/js/fluent-dynamo)\n[![build status](https://travis-ci.org/bakerface/fluent-dynamo.svg?branch=master)](https://travis-ci.org/bakerface/fluent-dynamo)\n[![code climate](https://codeclimate.com/github/bakerface/fluent-dynamo/badges/gpa.svg)](https://codeclimate.com/github/bakerface/fluent-dynamo)\n[![test coverage](https://codeclimate.com/github/bakerface/fluent-dynamo/badges/coverage.svg)](https://codeclimate.com/github/bakerface/fluent-dynamo/coverage)\n[![github issues](https://img.shields.io/github/issues/bakerface/fluent-dynamo.svg)](https://github.com/bakerface/fluent-dynamo/issues)\n[![dependencies](https://david-dm.org/bakerface/fluent-dynamo.svg)](https://david-dm.org/bakerface/fluent-dynamo)\n[![dev dependencies](https://david-dm.org/bakerface/fluent-dynamo/dev-status.svg)](https://david-dm.org/bakerface/fluent-dynamo#info=devDependencies)\n[![downloads](http://img.shields.io/npm/dm/fluent-dynamo.svg)](https://www.npmjs.com/package/fluent-dynamo)\n\n### dynamo.createTable(table)\nCreates a table with the specified configuration (see [CreateTable](http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_CreateTable.html)). Below is an example of creating a table with a global secondary index and a local secondary index.\n\n``` javascript\nvar fluent = require('fluent-dynamo');\n\nvar dynamo = fluent()\n  .withAccessKeyId('YOUR_ACCESS_KEY_ID')\n  .withRegion('YOUR_REGION')\n  .withSecretAccessKey('YOUR_SECRET_ACCESS_KEY');\n\ndynamo.createTable('Thread')\n  .withHashKey('ForumName').asString()\n  .withRangeKey('Subject').asString()\n  .withReadCapacity(5)\n  .withWriteCapacity(5)\n  .withGlobalSecondaryIndex('PostCountIndex')\n    .withHashKey('ForumName').asString()\n    .withRangeKey('PostCount').asNumber()\n    .withReadCapacity(1)\n    .withWriteCapacity(1)\n    .withAllAttributesProjection()\n  .withLocalSecondaryIndex('LastPostIndex')\n    .withHashKey('ForumName').asString()\n    .withRangeKey('LastPostDateTime').asString()\n    .withKeysOnlyProjection()\n  .then(function() {\n    // the table was created\n  })\n  .catch(function(reason) {\n    // an error occurred\n  });\n```\n\n### dynamo.putItem(table)\nCreates a new item or replaces an existing item in the table (see [PutItem](http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_PutItem.html)). Below is an example of inserting an item with attribute conditions.\n\n``` javascript\nvar fluent = require('fluent-dynamo');\n\nvar dynamo = fluent()\n  .withAccessKeyId('YOUR_ACCESS_KEY_ID')\n  .withRegion('YOUR_REGION')\n  .withSecretAccessKey('YOUR_SECRET_ACCESS_KEY');\n\ndynamo.putItem('Thread')\n  .withAttribute('ForumName').asString('Amazon')\n  .withAttribute('Subject').asString('DynamoDB')\n  .withAttribute('LastPostDateTime').asString('201303190422')\n  .withAttribute('PostCount').asNumber(100)\n  .withCondition('ForumName').isNotEqualToString('Amazon')\n  .withCondition('Subject').isNotEqualToString('DynamoDB');\n  .then(function() {\n    // the item was inserted into the table\n  })\n  .catch(function(reason) {\n    // an error occurred\n  });\n```\n\n### dynamo.deleteItem(table)\nDeletes an item in the table (see [DeleteItem](http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteItem.html)). Below is an example of deleting an item with a specific hash key and range key.\n\n``` javascript\nvar fluent = require('fluent-dynamo');\n\nvar dynamo = fluent()\n  .withAccessKeyId('YOUR_ACCESS_KEY_ID')\n  .withRegion('YOUR_REGION')\n  .withSecretAccessKey('YOUR_SECRET_ACCESS_KEY');\n\ndynamo.deleteItem('Thread')\n  .withHashKey('ForumName').asString('Amazon')\n  .withRangeKey('Subject').asString('DynamoDB')\n  .then(function() {\n    // the item was deleted from the table\n  })\n  .catch(function(reason) {\n    // an error occurred\n  });\n```\n\n### dynamo.query(table)\nSearches for items in the table (see [Query](http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html)). Below is an example of querying for an item by a specific hash key.\n\n``` javascript\nvar fluent = require('fluent-dynamo');\n\nvar dynamo = fluent()\n  .withAccessKeyId('YOUR_ACCESS_KEY_ID')\n  .withRegion('YOUR_REGION')\n  .withSecretAccessKey('YOUR_SECRET_ACCESS_KEY');\n\ndynamo.query('Thread')\n  .withConsistentRead()\n  .withCondition('ForumName').isEqualToString('Amazon')\n  .then(function(items) {\n    // the items were found and are in the following format:\n\n    // items = [\n    //   {\n    //     ForumName: 'Amazon',\n    //     Subject: 'DynamoDB',\n    //     PostCount: 100\n    //   },\n    //   {\n    //     ForumName: 'Amazon',\n    //     Subject: 'Elastic Beanstalk',\n    //     PostCount: 50\n    //   }\n    // ];\n  })\n  .catch(function(reason) {\n    // an error occurred\n  });\n```\n\n### dynamo.deleteTable(table)\nDeletes the table (see [DeleteTable](http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteTable.html)). Below is an example of deleting a table by name.\n\n``` javascript\nvar fluent = require('fluent-dynamo');\n\nvar dynamo = fluent()\n  .withAccessKeyId('YOUR_ACCESS_KEY_ID')\n  .withRegion('YOUR_REGION')\n  .withSecretAccessKey('YOUR_SECRET_ACCESS_KEY');\n\ndynamo.deleteTable('Thread')\n  .then(function() {\n    // the table was deleted\n  })\n  .catch(function(reason) {\n    // an error occurred\n  });\n```\n\n### dynamo.updateItem(table)\nUpdates and item in a table (see [UpdateItem](http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateItem.html)). Below is an example of updating an attribute in a table.\n\n``` javascript\nvar fluent = require('fluent-dynamo');\n\nvar dynamo = fluent()\n  .withAccessKeyId('YOUR_ACCESS_KEY_ID')\n  .withRegion('YOUR_REGION')\n  .withSecretAccessKey('YOUR_SECRET_ACCESS_KEY');\n\ndynamo.updateItem('Thread')\n  .withHashKey('ForumName').asString('Amazon')\n  .withRangeKey('Subject').asString('DynamoDB')\n  .withSetExpression('LastPostedBy').asString('alice@example.com')\n  .withRemoveExpression('Archived')\n  .withCondition('LastPostedBy').isEqualToString('fred@example.com')\n  .withAllNewReturnValues();\n  .then(function() {\n    // the \"LastPostedBy\" attribute is now \"alice@example.com\"\n    // and the \"Archived\" attribute is removed\n  })\n  .catch(function(reason) {\n    // an error occurred\n  });\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbakerface%2Ffluent-dynamo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbakerface%2Ffluent-dynamo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbakerface%2Ffluent-dynamo/lists"}