Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jpalumickas/uplo
Handle file uploads to different storage services like Amazon S3, Google Cloud or etc. It also supports different type of ORM adapters, like Prisma.
https://github.com/jpalumickas/uplo
aws aws-s3 digitalocean-spaces file file-upload file-upload-server file-uploader files gcs hacktoberfest javascript node nodejs prisma react react-native s3 upload uploader
Last synced: about 1 month ago
JSON representation
Handle file uploads to different storage services like Amazon S3, Google Cloud or etc. It also supports different type of ORM adapters, like Prisma.
- Host: GitHub
- URL: https://github.com/jpalumickas/uplo
- Owner: jpalumickas
- License: mit
- Created: 2021-05-04T15:08:24.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-17T21:03:38.000Z (about 2 months ago)
- Last Synced: 2024-10-04T11:55:41.813Z (about 1 month ago)
- Topics: aws, aws-s3, digitalocean-spaces, file, file-upload, file-upload-server, file-uploader, files, gcs, hacktoberfest, javascript, node, nodejs, prisma, react, react-native, s3, upload, uploader
- Language: TypeScript
- Homepage: https://uplo.js.org
- Size: 3.68 MB
- Stars: 11
- Watchers: 5
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Uplo
Handle file uploads to various storage services like Amazon S3, Google Cloud
or etc. It also supports various type of ORM adapters, like Prisma.## Features
* TypeScript ready
* Direct uploads
* Supports multiple services
* Multiple ORM adapters
* File analyzers## Getting started
Add `@uplo/node` to your package.json
```sh
yarn add @uplo/node
```Install Adapter (for example Prisma)
```sh
yarn add @uplo/adapter-prisma dataloader
```Install Service (for example S3)
```sh
yarn add @uplo/service-s3
```Define uplo instance
```ts
import Uplo from '@uplo/node';
import PrismaAdapter from '@uplo/adapter-prisma';
import GCSService from '@uplo/service-gcs';const config = {
privateKey: process.env.APPLICATION_SECRET, // Used to sign direct upload keys
signedIdExpiresIn: 60 * 60, // Time how long a Signed ID is valid
};const uplo = Uplo({
config,
adapter: new PrismaAdapter({ prisma }),
services: {
s3: S3Service({
isPublic: false,
region: process.env.AWS_REGION,
bucket: process.env.AWS_BUCKET,
accessKeyId: '*****',
secretAccessKey: '*****',
}),
},
attachments: {
user: {
avatar: true, // pass true to use default options
},
post: {
images: { multiple: true }
}
},
});const attachment = await uplo.attachments.user(123).avatar.attachFile(await blobFileInput({
path: '/home/images/image.png'
}))
```## License
The package is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).