@quatrain/storage-s3 1.1.21 → 1.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -12
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,26 +1,44 @@
|
|
|
1
1
|
# @quatrain/storage-s3
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The AWS S3 (and S3-compatible) adapter for `@quatrain/storage`.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Introduction
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- Works with any S3-compatible object storage provider.
|
|
9
|
-
- Leverages the official AWS SDK for JavaScript (`@aws-sdk/client-s3`).
|
|
10
|
-
- Supports multipart uploads for large files.
|
|
7
|
+
This adapter enables file operations across Amazon S3, Scaleway Object Storage, DigitalOcean Spaces, or any other S3-compatible service.
|
|
11
8
|
|
|
12
9
|
## Installation
|
|
13
10
|
|
|
14
11
|
```bash
|
|
15
12
|
npm install @quatrain/storage-s3 @aws-sdk/client-s3
|
|
13
|
+
# or
|
|
14
|
+
yarn add @quatrain/storage-s3 @aws-sdk/client-s3
|
|
16
15
|
```
|
|
17
16
|
|
|
18
|
-
##
|
|
17
|
+
## Configuration
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
import { Storage } from '@quatrain/storage';
|
|
22
|
-
import { S3StorageAdapter } from '@quatrain/storage-s3';
|
|
19
|
+
Initialize the adapter with your S3 credentials and endpoint.
|
|
23
20
|
|
|
24
|
-
|
|
25
|
-
Storage
|
|
21
|
+
```typescript
|
|
22
|
+
import { Storage } from '@quatrain/storage'
|
|
23
|
+
import { S3Adapter } from '@quatrain/storage-s3'
|
|
24
|
+
|
|
25
|
+
const s3Adapter = new S3Adapter({
|
|
26
|
+
config: {
|
|
27
|
+
accesskey: process.env.AWS_ACCESS_KEY_ID,
|
|
28
|
+
secret: process.env.AWS_SECRET_ACCESS_KEY,
|
|
29
|
+
region: process.env.AWS_REGION || 'eu-west-1',
|
|
30
|
+
// Provide endpoint if using an S3-compatible service like Scaleway
|
|
31
|
+
endpoint: 'https://s3.fr-par.scw.cloud'
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
Storage.addAdapter('s3', s3Adapter, true)
|
|
26
36
|
```
|
|
37
|
+
|
|
38
|
+
## Documentation
|
|
39
|
+
|
|
40
|
+
For concrete examples and usage guides, please refer to the [How-To Guide](HOWTO.md).
|
|
41
|
+
|
|
42
|
+
## License
|
|
43
|
+
|
|
44
|
+
AGPL-3.0-only
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quatrain/storage-s3",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.23",
|
|
4
4
|
"description": "Storage adapter for S3 compatible services",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@aws-sdk/client-s3": "^3.337.0",
|
|
29
29
|
"@aws-sdk/s3-request-presigner": "^3.342.0",
|
|
30
|
-
"@quatrain/storage": "^1.1.
|
|
30
|
+
"@quatrain/storage": "^1.1.32",
|
|
31
31
|
"fs-extra": "^11.2.0"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|