@quatrain/storage-s3 1.1.20 → 1.1.22

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.
Files changed (2) hide show
  1. package/README.md +26 -12
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,26 +1,40 @@
1
1
  # @quatrain/storage-s3
2
2
 
3
- A storage adapter for AWS S3 and other S3-compatible services like MinIO or DigitalOcean Spaces.
3
+ The AWS S3 (and S3-compatible) adapter for `@quatrain/storage`.
4
4
 
5
- ## Features
5
+ ## Introduction
6
6
 
7
- - Implements the `@quatrain/storage` abstract adapter.
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
- ## Usage
17
+ ## Configuration
19
18
 
20
- ```typescript
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
- const adapter = new S3StorageAdapter({ config: { region: 'us-east-1', credentials: { ... } } });
25
- Storage.addAdapter(adapter, 'default', true);
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
+ ## License
39
+
40
+ AGPL-3.0-only
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quatrain/storage-s3",
3
- "version": "1.1.20",
3
+ "version": "1.1.22",
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.29",
30
+ "@quatrain/storage": "^1.1.31",
31
31
  "fs-extra": "^11.2.0"
32
32
  },
33
33
  "scripts": {