https://github.com/tisankan/s3-file-uploader
A lightweight Node.js package for easy file uploads to Amazon S3. This package simplifies the process of configuring AWS S3 credentials and uploading files to S3 buckets in Node.js applications.
https://github.com/tisankan/s3-file-uploader
amazon-web-services aws-s3 aws-sdk cloud-storage developer-tools file-management file-upload nodejs nodejs-s3 npm-package
Last synced: 3 months ago
JSON representation
A lightweight Node.js package for easy file uploads to Amazon S3. This package simplifies the process of configuring AWS S3 credentials and uploading files to S3 buckets in Node.js applications.
- Host: GitHub
- URL: https://github.com/tisankan/s3-file-uploader
- Owner: Tisankan
- Created: 2024-02-16T17:45:55.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-27T06:44:34.000Z (9 months ago)
- Last Synced: 2025-01-05T03:42:14.077Z (5 months ago)
- Topics: amazon-web-services, aws-s3, aws-sdk, cloud-storage, developer-tools, file-management, file-upload, nodejs, nodejs-s3, npm-package
- Language: JavaScript
- Homepage:
- Size: 12.2 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: READMe.md
Awesome Lists containing this project
README
# s3-file-uploader
A simple Node.js package for uploading files to AWS S3. This package allows users to configure their own AWS S3 credentials and seamlessly upload files to their S3 buckets.
## Installation
```bash
npm install s3-file-uploader
```## Configuration
Create a config.js file in your project's root directory to store your AWS S3 credentials. Replace the placeholder values with your actual AWS S3 credentials:
```javascript
// config.js
module.exports = {
accessKeyId: 'YOUR_ACCESS_KEY_ID',
secretAccessKey: 'YOUR_SECRET_ACCESS_KEY',
region: 'YOUR_REGION',
bucketName: 'YOUR_BUCKET_NAME',
};
```
## UsageCreate a JavaScript file (e.g., app.js) in your project and use the s3-file-uploader package to upload a file to your S3 bucket:
```javascript
// app.js
const S3FileUploader = require('s3-file-uploader');
const config = require('./config'); // Load your AWS S3 credentials from config.jsconst uploader = new S3FileUploader(config);
const filePath = 'path/to/your/file.txt';
const destinationPath = 'destination/path/in/s3/file.txt';uploader.uploadFile(filePath, destinationPath)
.then(() => console.log('File uploaded successfully.'))
.catch((error) => console.error('Error uploading file:', error));
```
## AuthorName: Tisankan
Email: [email protected]## License
This project is licensed under the MIT License - see the LICENSE file for details.