Skip to content

It is a npm package, which let you upload your folder to s3.

Notifications You must be signed in to change notification settings

Ubaid-Manzoor/folder-upload-s3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Upload entire folders to Amazon S3 with ease! And without giving away yours us.

Installation

npm install upload-folder-s3

Usage

const UploadFolderS3 = require("upload-folder-to-s3");
const { S3Client } = require("@aws-sdk/client-s3");

// Configure AWS
const s3Client = new S3Client({
  region: "REGION",
  credentials: {
    accessKeyId: "ACCESS_KEY_ID",
    secretAccessKey: "SECRET_ACCESS_KEY",
  },
});

// Create an instance of the UploadFolderS3 class, we will only need client, no credentials
const uploadClient = new UploadFolderS3(s3Client);

// Upload folder to S3
uploadClient
  .upload({
    localFolderPath: "/local/folder/path",
    s3FolderPath: "s3/folder/path",
    bucketName: "YOUR_BUCKET_NAME",
  })
  .then(() => {
    console.log("Upload done");
  })
  .catch((error) => {
    console.error("Error uploading folder:", error);
  });

Parameters

  • localFolderPath: Path to the local folder you want to upload.
  • s3FolderPath: Path in the S3 bucket where you want to upload the folder.
  • bucketName: Name of the S3 bucket where you want to upload the folder.

Wishlist

  • Upload a entire folder to S3 instead file
  • Async upload of files to improve time
  • [] Return the list of files uploaded with the final URL
  • [] Retry the failed upload and return the status.
  • [] Batch Process, upload file in Batches

Contributing

Contributions are welcome! Feel free to submit a pull request or open an issue if you encounter any problems or have suggestions for improvements.

About

It is a npm package, which let you upload your folder to s3.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published