https://github.com/davidnguyen11/s3-upload
NodeJS small lib which allows to upload directory to S3.
https://github.com/davidnguyen11/s3-upload
amazon nodejs s3 s3-uploader s3-uploading
Last synced: about 2 months ago
JSON representation
NodeJS small lib which allows to upload directory to S3.
- Host: GitHub
- URL: https://github.com/davidnguyen11/s3-upload
- Owner: davidnguyen11
- Created: 2018-10-27T13:32:53.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-31T11:53:36.000Z (over 6 years ago)
- Last Synced: 2025-03-18T09:51:35.144Z (2 months ago)
- Topics: amazon, nodejs, s3, s3-uploader, s3-uploading
- Language: JavaScript
- Homepage:
- Size: 121 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# S3 Uploading
The small lib which allows to upload directory to AWS S3.
## Installation
**yarn**
```bash
yarn add s3-uploading -D
```**npm**
```bash
npm i s3-uploading -D
```## Usage
**upload.js**
```js
const Uploader = require('s3-uploading').defaultconst options = {
s3: {
accessKeyId: process.env.AWS_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
endpoint: process.env.AWS_HOST_BUCKET,
region: '',
ACL: 'public-read',
sslEnabled: false
},
upload: {
directory: '__tests__/fixtures/dir1',
bucket: `TEST_S3_UPLOADING`
}
}const uploading = new Uploader(options)
uploading.upload()
```**run**
```bash
AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_HOST_BUCKET= node upload.js
```## Options
### s3
Contains all the params of `AWS JavaScript SDK`. You could find it at the link below:
[https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html)### upload
#### directory> `string`
The path of directory that you want to upload.
#### bucket
> `string`
The name of the bucket that you want to upload the directory to.