Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matdombrock/s3_async
This module is an asynchronous wrapper for the NodeJS AWS SDK. It allows for the use of promises with some common (s3 related) synchronous functions provided by the AWS SDK.
https://github.com/matdombrock/s3_async
Last synced: 7 days ago
JSON representation
This module is an asynchronous wrapper for the NodeJS AWS SDK. It allows for the use of promises with some common (s3 related) synchronous functions provided by the AWS SDK.
- Host: GitHub
- URL: https://github.com/matdombrock/s3_async
- Owner: matdombrock
- Created: 2021-11-02T11:44:42.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-07-20T08:31:07.000Z (over 2 years ago)
- Last Synced: 2024-11-07T04:44:34.436Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# S3 Async Wrapper & CLI
This module is an asynchronous wrapper for the [NodeJS AWS SDK](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/s3-examples.html). It allows for the use of promises with some common (s3 related) synchronous functions provided by the AWS SDK.
## Authentication
To use this you will need a file named `credentials` in `~/.aws/`.This file should contain something like the following:
```
[default]
aws_access_key_id =
aws_secret_access_key =
region = us-west-2
```
## Create Bucket
Creates a new bucket with the given name on S3.### Module
`create(bucket)`
### Params
* bucket - The name of the bucket to create.## List Buckets
Return a list of all buckets associated with the given account and region.
### Module
`list()`
### Params
* none## Upload Item from File
Upload a file to the given bucket.
### Module
`uploadFile(bucket, target)`
### Params
* bucket - The name of the bucket to upload to.
* target - The local path of the file to upload## Upload Item from Buffer
Upload a "file" from a buffer.
### Module
`uploadData(bucket, data, fileName)`
### Params
* bucket - The name of the bucket to upload to.
* buffer - The data to upload.
* fileName - The name the file should have on S3.## List Items
Return a list of all items (objects) in the given bucket.
### Module
`listItems(bucket, prefix)`
### Params
* bucket - The name of the bucket to list from.
* prefix - The path prefix to apply when looking for items (optional).## Download Item
### Module
`download(bucket, target, destination)`
### Params
* bucket - The name of the bucket to download from.
* target - The name of the file (item/object) to download.
* destination - The local destination of the downloaded item.