https://github.com/kbrashears5/typescript-aws-s3-helper
Typescript AWS S3 Helper
https://github.com/kbrashears5/typescript-aws-s3-helper
aws helper javascript lambda s3 typescript
Last synced: 5 months ago
JSON representation
Typescript AWS S3 Helper
- Host: GitHub
- URL: https://github.com/kbrashears5/typescript-aws-s3-helper
- Owner: kbrashears5
- License: mit
- Created: 2020-05-27T00:19:36.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-01T05:20:51.000Z (over 1 year ago)
- Last Synced: 2025-03-06T04:25:32.156Z (9 months ago)
- Topics: aws, helper, javascript, lambda, s3, typescript
- Language: TypeScript
- Homepage: https://github.com/kbrashears5/typescript-aws-s3-helper#readme
- Size: 105 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
typescript-aws-s3-helper
Typescript helper functions for AWS S3 service
[](https://github.com/kbrashears5/typescript-aws-s3-helper/actions/workflows/ci-cd.yml)
[](https://codecov.io/gh/kbrashears5/typescript-aws-s3-helper)
[](https://img.shields.io/npm/v/typescript-aws-s3-helper)
[](https://img.shields.io/npm/dt/typescript-aws-s3-helper)
## Install
```
npm install typescript-aws-s3-helper@latest
```
## Usage
### Default - running in Lambda in your own account
```typescript
const logger = new Logger(LogLevel.Trace);
const helper = new S3Helper(logger);
const response = await helper.CreateBucketAsync('name');
```
### Running in separate account or not in Lambda
```typescript
import * as S3 from '@aws-sdk/client-s3';
const logger = new Logger(LogLevel.Trace);
const options: S3.S3ClientConfig = {
accessKeyId: '{access_key}',
secretAccessKey: '{secret_key}',
region: 'us-east-1',
};
const repository = new S3.S3(options);
const helper = new S3Helper(logger, repository);
const response = await helper.CreateBucketAsync('name');
```
## Notes
If no options are supplied, will default to `us-east-1` as the region
## Development
Clone the latest and run
```npm
npm run prep
```
to install packages and prep the git hooks