{"id":15575668,"url":"https://github.com/hsyntes/aws-cloud-storage","last_synced_at":"2026-04-11T12:44:49.079Z","repository":{"id":185696819,"uuid":"673954926","full_name":"hsyntes/aws-cloud-storage","owner":"hsyntes","description":"Effortlessly integrate AWS Cloud Object Storage (e.g., S3) with Node.js applications. Manage uploads, downloads, storage operations seamlessly and save them to the MongoDB . Leverage scalability and security of AWS for your data needs. Get started quickly with clear examples and documentation.","archived":false,"fork":false,"pushed_at":"2023-08-06T01:11:04.000Z","size":22430,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T07:25:10.201Z","etag":null,"topics":["aws","aws-s3","awscloud","express","mongodb","nodejs","rest-api"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hsyntes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-02T20:02:30.000Z","updated_at":"2023-08-04T04:49:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"ef39ea0e-a495-4c5f-91b0-486f93836faf","html_url":"https://github.com/hsyntes/aws-cloud-storage","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"f72204965a02e02163a80327001e636ac1c4cedf"},"previous_names":["hsyntes/aws-cloud-storage"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hsyntes/aws-cloud-storage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsyntes%2Faws-cloud-storage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsyntes%2Faws-cloud-storage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsyntes%2Faws-cloud-storage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsyntes%2Faws-cloud-storage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hsyntes","download_url":"https://codeload.github.com/hsyntes/aws-cloud-storage/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hsyntes%2Faws-cloud-storage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31681201,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T08:18:19.405Z","status":"ssl_error","status_checked_at":"2026-04-11T08:17:08.892Z","response_time":54,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["aws","aws-s3","awscloud","express","mongodb","nodejs","rest-api"],"created_at":"2024-10-02T18:40:20.247Z","updated_at":"2026-04-11T12:44:49.061Z","avatar_url":"https://github.com/hsyntes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node.js AWS Cloud Object Storage Integration\n\nWelcome to the documentation for the Node.js AWS Cloud Object Storage Integration repository. This guide will walk you through the process of seamlessly integrating Amazon Web Services (AWS) Cloud Object Storage, such as AWS S3, with your Node.js applications. By leveraging AWS's powerful and scalable storage solutions, you can efficiently manage your application's data storage needs.\n\n## Introduction\n\nThe Node.js AWS Cloud Object Storage Integration repository provides a simple and efficient way to integrate AWS Cloud Object Storage services into your Node.js applications. Whether you're building a web application, a backend service, or any other type of software, this integration allows you to store, retrieve, and manage files effortlessly using AWS's reliable and scalable infrastructure.\n\n## Prerequisites\n\nBefore you begin, make sure you have the following prerequisites:\n\n- Node.js\n- multer npm package\n- Aws Account with Cloud Object Storage (e.g, S3) access\n\n## Installation\n\nTo install the Node.js AWS Cloud Object Storage Integration package, run:\n\n`npm install aws-sdk multer`\n\nOptional\n\n`npm install sharp`\n\n## Usage\n\n### Initializing AWS SDK\n\nTo start using AWS services, you need to initialize the AWS SDK with your credentials. You can set your credentials using environment variables, AWS configuration files, or directly in your code. Here's an example of initializing the SDK:\n\n```javascript\nconst AWS = require(\"aws-sdk\");\n\n// AWS Configuration\nAWS.config.update({\n  accessKeyId: \"YOUR_ACCESS_KEY\",\n  secretAccessKey: \"YOUR_SECRET_KEY\",\n  region: \"YOUR_REGION\",\n});\n\n// Create an S3 instance\nconst s3 = new AWS.S3();\n```\n\n### Uploading Files\n\n```javascript\nconst params = {\n  Bucket: \"your-bucket-name\", // Folder name in AWS\n  Key: \"file-name.jpg\", // Path\n  Body: \"File content\", // File\n};\n\ns3.upload(params, (err, data) =\u003e {\n  if (err) {\n    console.error(\"Error uploading:\", err);\n  } else {\n    console.log(\"Upload successful:\", data.Location);\n  }\n});\n```\n\n### Uploading Multiple Files\n\n```javascript\nconst { files } = req;\n\nfor (const file of files) {\n  const params = {\n    Bucket: process.env.AWS_Bucket,\n    Key: `users/${req.user.username}/${file.originalname}`,\n    Body: file.buffer,\n  };\n\n  try {\n    const data = await s3.upload(params).promise();\n  } catch (err) {\n    console.error(\"Error uploading:\", err);\n  }\n}\n```\n\n### Downloading Files\n\nDownloading files from AWS Cloud Object Storage is equally straightforward:\n\n```javascript\nconst params = {\n  Bucket: \"your-bucket-name\",\n  Key: \"file-name.jpg\",\n};\n\ns3.getObject(params, (err, data) =\u003e {\n  if (err) {\n    console.error(\"Error downloading:\", err);\n  } else {\n    console.log(\"Downloaded content:\", data.Body.toString());\n  }\n});\n```\n\n### Deleting Files\n\nTo delete a file:\n\n```javascript\nconst params = {\n  Bucket: \"your-bucket-name\",\n  Key: \"file-name.jpg\",\n};\n\ns3.deleteObject(params, (err, data) =\u003e {\n  if (err) {\n    console.error(\"Error deleting:\", err);\n  } else {\n    console.log(\"Deletion successful\");\n  }\n});\n```\n\nTo delete multiple files\n\n```javascript\nconst params = {\n  Bucket: process.env.AWS_BUCKET,\n  Prefix: `posts/${user.username}`,\n};\n\nconst objects = await s3.listObjectsV2(params).promise();\n\nif (objects?.Contents.length !== 0) {\n  const deleteParams = {\n    Bucket: process.env.AWS_BUCKET,\n    Delete: {\n      Objects: objects.Contents.map((object) =\u003e ({ Key: object.Key })),\n    },\n  };\n\n  s3.deleteObjects(deleteParams, (err) =\u003e {\n    if (err)\n      return next(\n        new ErrorProvider(403, \"fail\", \"Couldn't delete user's posts.\")\n      );\n  });\n}\n```\n\n## Security Considerations\n\nWhen working with AWS Cloud Object Storage, ensure you follow security best practices:\n\n- Use IAM roles and permissions to control access.\n- Implement server-side encryption for sensitive data.\n\n## 🔗 Contact\n\nFor questions or feedback, reach out to me.\n\n[![linkedin](https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge\u0026logo=linkedin\u0026logoColor=white)](https://www.linkedin.com/in/hsyntes)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhsyntes%2Faws-cloud-storage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhsyntes%2Faws-cloud-storage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhsyntes%2Faws-cloud-storage/lists"}