Skip to content

Commit

Permalink
Made Readme to look nice (I hope :/)
Browse files Browse the repository at this point in the history
  • Loading branch information
SergkeiM committed Mar 15, 2023
1 parent 2a8b095 commit afca3c9
Showing 1 changed file with 31 additions and 22 deletions.
53 changes: 31 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
<p align='center'>
<br>
S3 compatible file uploader Plugin for Vite
</p>

@froxz/vite-plugin-s3
===
[![Travis Badge](https://api.travis-ci.org/Froxz/vite-plugin-s3.svg?branch=master)](https://travis-ci.org/Froxz/vite-plugin-s3)
[![Verified on Openbase](https://badges.openbase.com/js/verified/@froxz/vite-plugin-s3.svg?token=+2YA8n/SOL3DiSFWWLusfYyOwyXAeNo24ynF9UtjTPY=)](https://openbase.com/js/@froxz/vite-plugin-s3?utm_source=embedded&amp;utm_medium=badge&amp;utm_campaign=rate-badge)
<p align='center'>
<a href='https://www.npmjs.com/package/@froxz/vite-plugin-s3' target="__blank">
<img src='https://img.shields.io/npm/v/@froxz/vite-plugin-s3?color=33A6B8&label=' alt="NPM version">
</a>
<a href="https://www.npmjs.com/package/@froxz/vite-plugin-s3" target="__blank">
<img alt="NPM Downloads" src="https://img.shields.io/npm/dm/@froxz/vite-plugin-s3?color=476582&label=">
</a>
<br>
<a href="https://github.com/Froxz/vite-plugin-s3" target="__blank">
<img alt="GitHub stars" src="https://img.shields.io/github/stars/Froxz/vite-plugin-s3?style=social">
</a>
</p>

This package was heavily inspired by [webpack-s3-plugin](https://www.npmjs.com/package/webpack-s3-plugin)

Allows you to upload files to S3 `@aws-sdk/client-s3` **v3**

### Install Instructions
## 📦 Install

```bash
$ npm i @froxz/vite-plugin-s3
```

### Options

- `exclude`: A Pattern to match for excluded content.
- `include`: A Pattern to match for included content.
- `clientConfig`: Provide keys for upload options of [S3ClientConfig](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-s3/interfaces/s3clientconfig.html)
- `uploadOptions`: Provide upload options [PutObjectRequest](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-s3/interfaces/putobjectrequest.html)
- `basePath`: Provide the namespace of uploaded files on S3
- `directory`: Provide a directory to upload (if not supplied, will upload files from [build.outDir](https://vitejs.dev/config/build-options.html#build-outdir))

### Usage Instructions
## 🦄 Usage

> `uploadOptions` default to `ACL: 'public-read'` so you may need to override if you have other needs.
Add `vite-plugin-s3` plugin to `vite.config.js / vite.config.ts` and configure it:

```javascript
import { defineConfig } from 'vite'
import S3Plugin from '@froxz/vite-plugin-s3'
Expand All @@ -51,6 +51,15 @@ export default defineConfig({
})
```

### License
## 🚀 Options

- `exclude`: A Pattern to match for excluded content.
- `include`: A Pattern to match for included content.
- `clientConfig`: Provide keys for upload options of [S3ClientConfig](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-s3/interfaces/s3clientconfig.html)
- `uploadOptions`: Provide upload options [PutObjectRequest](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-s3/interfaces/putobjectrequest.html)
- `basePath`: Provide the namespace of uploaded files on S3
- `directory`: Provide a directory to upload (if not supplied, will upload files from [build.outDir](https://vitejs.dev/config/build-options.html#build-outdir))

## 📄 License

[MIT](LICENSE)
MIT License [Froxz](LICENSE)

0 comments on commit afca3c9

Please sign in to comment.