Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/onesy-me/aws

AWS
https://github.com/onesy-me/aws

amaui aws aws-s3 aws-sdk aws-sdk-javascript aws-sdk-js browser express expressjs javascript js library node nodejs typescript utils web

Last synced: 10 days ago
JSON representation

AWS

Awesome Lists containing this project

README

        



onesy logo

onesy AWS


AWS



MIT license    
Production ready    
100% test cov    
Nodejs


Very simple code    
Modern code    
Junior friendly    
Typescript    
Made with :yellow_heart:


## Getting started

### Add

```sh
yarn add @onesy/aws
```

Add `@aws-sdk/client-s3` peer dependency.

```sh
yarn add @aws-sdk/client-s3
```

### Use

```javascript
import OnesyAws from '@onesy/aws';

// Make if you wanna a config file and
// inside of it add all the process.env related props
import Config from './config';

// Make a new aws instance
const onesyAws = new OnesyAws({
s3: {
bucketName: Config.aws.s3.bucketName,

credentials: {
accessKeyId: Config.aws.s3.accessKeyId,
secretAccessKey: Config.aws.s3.secretAccessKey
},

endpoint: Config.aws.s3.endpoint,

region: Config.aws.s3.region
}
});

// Add
await onesyAws.s3.add('a', 4);

// Get
await onesyAws.s3.get('a');

// 4

// Remove
await onesyAws.s3.remove('a');

await onesyAws.s3.get('a');

// undefined
```

### Dev

Install

```sh
yarn
```

Test

```sh
yarn test
```

#### One time local setup

Install docker and docker-compose

- https://docs.docker.com/get-docker
- https://docs.docker.com/compose/install

Install aws

- https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html

Make docker containers

```sh
yarn docker
```

### Prod

Build

```sh
yarn build
```