@techupwithfatma/s3-image-uploader
v1.0.1
Published
A simple NPM package to upload images to an Amazon S3 bucket.
Downloads
131
Readme
S3 Image Uploader
A simple NPM package to upload images to an Amazon S3 bucket.
Installation
npm install s3-image-uploader
## Eaemple
import S3ImageUploader from "@techupwithfatma/s3-image-uploader";
const bucketName = 'your-bucket-name';
const accessKeyId = 'your-access-key-id';
const secretAccessKey = 'your-secret-access-key';
const region = 'your-region';
const uploader = new S3ImageUploader(bucketName, accessKeyId, secretAccessKey, region);
async function uploadImage() {
const imagePath = 'path/to/your/image.jpg'; // Update with your image path
try {
const imageUrl = await uploader.uploadImage(imagePath);
console.log('Image URL:', imageUrl);
} catch (error) {
console.error('Upload failed:', error);
}
}