@@ -31,8 +31,8 @@ npm install @tus/s3-store
3131## Use
3232
3333``` js
34- const { Server } = require ( ' @tus/server' )
35- const { S3Store } = require ( ' @tus/s3-store' )
34+ import { Server } from " @tus/server" ;
35+ import { S3Store } from " @tus/s3-store" ;
3636
3737const s3Store = new S3Store ({
3838 partSize: 8 * 1024 * 1024 , // Each uploaded part will have ~8MiB,
@@ -44,8 +44,8 @@ const s3Store = new S3Store({
4444 secretAccessKey: process .env .AWS_SECRET_ACCESS_KEY ,
4545 },
4646 },
47- })
48- const server = new Server ({path: ' /files' , datastore: s3Store})
47+ });
48+ const server = new Server ({ path: " /files" , datastore: s3Store });
4949// ...
5050```
5151
@@ -199,22 +199,22 @@ docs for the supported values of
199199[ credentials] ( https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Credentials.html#constructor-property )
200200
201201``` js
202- const aws = require ( ' aws-sdk' )
203- const { Server } = require ( ' @tus/server' )
204- const { S3Store } = require ( ' @tus/s3-store' )
202+ import aws from " aws-sdk" ;
203+ import { Server } from " @tus/server" ;
204+ import { S3Store } from " @tus/s3-store" ;
205205
206206const s3Store = new S3Store ({
207207 partSize: 8 * 1024 * 1024 ,
208208 s3ClientConfig: {
209209 bucket: process .env .AWS_BUCKET ,
210210 region: process .env .AWS_REGION ,
211211 credentials: new aws.ECSCredentials ({
212- httpOptions: {timeout: 5000 },
212+ httpOptions: { timeout: 5000 },
213213 maxRetries: 10 ,
214214 }),
215215 },
216- })
217- const server = new Server ({path: ' /files' , datastore: s3Store})
216+ });
217+ const server = new Server ({ path: " /files" , datastore: s3Store });
218218// ...
219219```
220220
@@ -231,7 +231,7 @@ const s3Store = new S3Store({
231231 partSize: 8 * 1024 * 1024 ,
232232 minPartSize: 8 * 1024 * 1024 ,
233233 // ...
234- })
234+ });
235235```
236236
237237### Example: use with Scaleway Object Storage
@@ -242,7 +242,7 @@ const s3Store = new S3Store({
242242const s3Store = new S3Store ({
243243 maxMultipartParts: 1000 ,
244244 // ...
245- })
245+ });
246246```
247247
248248## Types
@@ -265,16 +265,12 @@ See
265265
266266[ extensions ] : https://tus.io/protocols/resumable-upload.html#protocol-extensions
267267[ creation ] : https://tus.io/protocols/resumable-upload.html#creation
268- [ creation with upload] :
269- https://tus.io/protocols/resumable-upload.html#creation-with-upload
268+ [ creation with upload ] : https://tus.io/protocols/resumable-upload.html#creation-with-upload
270269[ expiration ] : https://tus.io/protocols/resumable-upload.html#expiration
271270[ checksum ] : https://tus.io/protocols/resumable-upload.html#checksum
272271[ termination ] : https://tus.io/protocols/resumable-upload.html#termination
273272[ concatenation ] : https://tus.io/protocols/resumable-upload.html#concatenation
274- [ cleanExpiredUploads] :
275- https://github.com/tus/tus-node-server/tree/main/packages/server#servercleanupexpireduploads
276- [ lifecyle] :
277- https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html
273+ [ cleanExpiredUploads ] : https://github.com/tus/tus-node-server/tree/main/packages/server#servercleanupexpireduploads
274+ [ lifecyle ] : https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html
278275[ kvstores ] : https://github.com/tus/tus-node-server/tree/main/packages/server#kvstores
279- [ ` KvStore ` ] :
280- https://github.com/tus/tus-node-server/blob/main/packages/utils/src/kvstores/Types.ts
276+ [ `KvStore` ] : https://github.com/tus/tus-node-server/blob/main/packages/utils/src/kvstores/Types.ts
0 commit comments