Skip to content

Commit 4523e10

Browse files
committed
Update readme's, CI, and tsconfig
1 parent 5fd6038 commit 4523e10

File tree

9 files changed

+187
-206
lines changed

9 files changed

+187
-206
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ concurrency: ${{ github.workflow }}--${{ github.ref }}
1616

1717
jobs:
1818
main:
19-
name: Node.js LTS
19+
name: Node.js 20
2020
runs-on: ubuntu-latest
2121

2222
steps:
@@ -33,7 +33,7 @@ jobs:
3333
- name: Install Node.js
3434
uses: actions/setup-node@v3
3535
with:
36-
node-version: lts/*
36+
node-version: 20
3737

3838
- name: Install dependencies
3939
run: npm ci --no-fund --no-audit

README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@ A standalone server which stores files on disk.
5252
> Try it yourself in [StackBlitz](https://stackblitz.com/edit/stackblitz-starters-zg6mgnuf?file=index.js)
5353
5454
```js
55-
const {Server} = require('@tus/server')
56-
const {FileStore} = require('@tus/file-store')
55+
const { Server } = require("@tus/server");
56+
const { FileStore } = require("@tus/file-store");
5757

58-
const host = '127.0.0.1'
59-
const port = 1080
58+
const host = "127.0.0.1";
59+
const port = 1080;
6060
const server = new Server({
61-
path: '/files',
62-
datastore: new FileStore({directory: './files'}),
63-
})
61+
path: "/files",
62+
datastore: new FileStore({ directory: "./files" }),
63+
});
6464

65-
server.listen({host, port})
65+
server.listen({ host, port });
6666
```
6767

6868
A tus server integrated into your existing Node.js server. `@tus/server` has no
@@ -124,7 +124,7 @@ All packages are fully typed with TypeScript.
124124

125125
## Compatibility
126126

127-
All packages require Node.js 16.0+.
127+
All packages require Node.js 20+.
128128

129129
## Contribute
130130

@@ -144,8 +144,7 @@ See
144144
[`@tus/azure-store`]: https://github.com/tus/tus-node-server/tree/main/packages/azure-store
145145
[extensions]: https://tus.io/protocols/resumable-upload.html#protocol-extensions
146146
[creation]: https://tus.io/protocols/resumable-upload.html#creation
147-
[creation with upload]:
148-
https://tus.io/protocols/resumable-upload.html#creation-with-upload
147+
[creation with upload]: https://tus.io/protocols/resumable-upload.html#creation-with-upload
149148
[expiration]: https://tus.io/protocols/resumable-upload.html#expiration
150149
[checksum]: https://tus.io/protocols/resumable-upload.html#checksum
151150
[termination]: https://tus.io/protocols/resumable-upload.html#termination

packages/azure-store/README.md

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Azure Store based on the Append Blob Client [Azure Blob AppendBlobClient](https:
1616

1717
## Install
1818

19-
In Node.js (16.0+), install with npm:
19+
In Node.js (20+), install with npm:
2020

2121
```bash
2222
npm install @tus/azure-store
@@ -25,17 +25,17 @@ npm install @tus/azure-store
2525
## Use
2626

2727
```js
28-
const {Server} = require('@tus/server')
29-
const {AzureStore} = require('@tus/azure-store')
28+
const { Server } = require("@tus/server");
29+
const { AzureStore } = require("@tus/azure-store");
3030

3131
const server = new Server({
32-
path: '/files',
32+
path: "/files",
3333
datastore: new AzureStore({
34-
account: process.env.AZURE_ACCOUNT_ID,
35-
accountKey: process.env.AZURE_ACCOUNT_KEY,
36-
containerName: process.env.AZURE_CONTAINER_NAME,
34+
account: process.env.AZURE_ACCOUNT_ID,
35+
accountKey: process.env.AZURE_ACCOUNT_KEY,
36+
containerName: process.env.AZURE_CONTAINER_NAME,
3737
}),
38-
})
38+
});
3939
// ...
4040
```
4141

@@ -84,7 +84,7 @@ This package is fully typed with TypeScript.
8484

8585
## Compatibility
8686

87-
This package requires Node.js 16.0+.
87+
This package requires Node.js 20+.
8888

8989
## Contribute
9090

@@ -98,17 +98,12 @@ See
9898

9999
[extensions]: https://tus.io/protocols/resumable-upload.html#protocol-extensions
100100
[creation]: https://tus.io/protocols/resumable-upload.html#creation
101-
[creation with upload]:
102-
https://tus.io/protocols/resumable-upload.html#creation-with-upload
101+
[creation with upload]: https://tus.io/protocols/resumable-upload.html#creation-with-upload
103102
[expiration]: https://tus.io/protocols/resumable-upload.html#expiration
104103
[checksum]: https://tus.io/protocols/resumable-upload.html#checksum
105104
[termination]: https://tus.io/protocols/resumable-upload.html#termination
106105
[concatenation]: https://tus.io/protocols/resumable-upload.html#concatenation
107-
[`cleanUpExpiredUploads`]:
108-
https://github.com/tus/tus-node-server/tree/main/packages/server#cleanupexpireduploads
106+
[`cleanUpExpiredUploads`]: https://github.com/tus/tus-node-server/tree/main/packages/server#cleanupexpireduploads
109107
[kvstores]: https://github.com/tus/tus-node-server/tree/main/packages/server#kvstores
110-
[`KvStore`]:
111-
https://github.com/tus/tus-node-server/blob/main/packages/utils/src/kvstores/Types.ts
112-
113-
[`MemoryKvStore`]:
114-
https://github.com/tus/tus-node-server/blob/main/packages/utils/src/kvstores/MemoryKvStore.ts
108+
[`KvStore`]: https://github.com/tus/tus-node-server/blob/main/packages/utils/src/kvstores/Types.ts
109+
[`MemoryKvStore`]: https://github.com/tus/tus-node-server/blob/main/packages/utils/src/kvstores/MemoryKvStore.ts

packages/file-store/README.md

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
## Install
2222

23-
In Node.js (16.0+), install with npm:
23+
In Node.js (20+), install with npm:
2424

2525
```bash
2626
npm install @tus/file-store
@@ -29,13 +29,13 @@ npm install @tus/file-store
2929
## Use
3030

3131
```js
32-
const {Server} = require('@tus/server')
33-
const {FileStore} = require('@tus/file-store')
32+
const { Server } = require("@tus/server");
33+
const { FileStore } = require("@tus/file-store");
3434

3535
const server = new Server({
36-
path: '/files',
37-
datastore: new FileStore({directory: './some/path'}),
38-
})
36+
path: "/files",
37+
datastore: new FileStore({ directory: "./some/path" }),
38+
});
3939
// ...
4040
```
4141

@@ -87,25 +87,25 @@ For demonstration purposes we will create a memory config store, but that's not
8787
idea. It's written in TypeScript.
8888

8989
```ts
90-
import type {Upload} from '@tus/server'
90+
import type { Upload } from "@tus/server";
9191

9292
export class MemoryConfigstore {
93-
data: Map<string, Upload> = new Map()
93+
data: Map<string, Upload> = new Map();
9494

9595
get(key: string): Upload | undefined {
96-
return this.data.get(key)
96+
return this.data.get(key);
9797
}
9898

9999
set(key: string, value: Upload) {
100-
this.data.set(key, value)
100+
this.data.set(key, value);
101101
}
102102

103103
delete(key: string) {
104-
return this.data.delete(key)
104+
return this.data.delete(key);
105105
}
106106

107107
get list(): Record<string, Upload> {
108-
return Object.fromEntries(this.data.entries())
108+
return Object.fromEntries(this.data.entries());
109109
}
110110
}
111111
```
@@ -124,7 +124,7 @@ This package is fully typed with TypeScript.
124124

125125
## Compatibility
126126

127-
This package requires Node.js 16.0+.
127+
This package requires Node.js 20+.
128128

129129
## Contribute
130130

@@ -138,14 +138,11 @@ See
138138

139139
[extensions]: https://tus.io/protocols/resumable-upload.html#protocol-extensions
140140
[creation]: https://tus.io/protocols/resumable-upload.html#creation
141-
[creation with upload]:
142-
https://tus.io/protocols/resumable-upload.html#creation-with-upload
141+
[creation with upload]: https://tus.io/protocols/resumable-upload.html#creation-with-upload
143142
[expiration]: https://tus.io/protocols/resumable-upload.html#expiration
144143
[checksum]: https://tus.io/protocols/resumable-upload.html#checksum
145144
[termination]: https://tus.io/protocols/resumable-upload.html#termination
146145
[concatenation]: https://tus.io/protocols/resumable-upload.html#concatenation
147-
[`cleanUpExpiredUploads`]:
148-
https://github.com/tus/tus-node-server/tree/main/packages/server#cleanupexpireduploads
146+
[`cleanUpExpiredUploads`]: https://github.com/tus/tus-node-server/tree/main/packages/server#cleanupexpireduploads
149147
[kvstores]: https://github.com/tus/tus-node-server/tree/main/packages/server#kvstores
150-
[`KvStore`]:
151-
https://github.com/tus/tus-node-server/blob/main/packages/utils/src/kvstores/Types.ts
148+
[`KvStore`]: https://github.com/tus/tus-node-server/blob/main/packages/utils/src/kvstores/Types.ts

packages/gcs-store/README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
## Install
1919

20-
In Node.js (16.0+), install with npm:
20+
In Node.js (20+), install with npm:
2121

2222
```bash
2323
npm install @tus/gcs-store
@@ -26,19 +26,19 @@ npm install @tus/gcs-store
2626
## Use
2727

2828
```js
29-
const {Server} = require('@tus/server')
30-
const {GCSStore} = require('@tus/gcs-store')
29+
const { Server } = require("@tus/server");
30+
const { GCSStore } = require("@tus/gcs-store");
3131

32-
const {Storage} = require('@google-cloud/storage')
32+
const { Storage } = require("@google-cloud/storage");
3333

34-
const storage = new Storage({keyFilename: 'key.json'})
34+
const storage = new Storage({ keyFilename: "key.json" });
3535

3636
const server = new Server({
37-
path: '/files',
37+
path: "/files",
3838
datastore: new GCSStore({
39-
bucket: storage.bucket('tus-node-server-ci'),
39+
bucket: storage.bucket("tus-node-server-ci"),
4040
}),
41-
})
41+
});
4242
// ...
4343
```
4444

@@ -74,7 +74,7 @@ This package is fully typed with TypeScript.
7474

7575
## Compatibility
7676

77-
This package requires Node.js 16.0+.
77+
This package requires Node.js 20+.
7878

7979
## Contribute
8080

@@ -88,8 +88,7 @@ See
8888

8989
[extensions]: https://tus.io/protocols/resumable-upload.html#protocol-extensions
9090
[creation]: https://tus.io/protocols/resumable-upload.html#creation
91-
[creation with upload]:
92-
https://tus.io/protocols/resumable-upload.html#creation-with-upload
91+
[creation with upload]: https://tus.io/protocols/resumable-upload.html#creation-with-upload
9392
[expiration]: https://tus.io/protocols/resumable-upload.html#expiration
9493
[checksum]: https://tus.io/protocols/resumable-upload.html#checksum
9594
[termination]: https://tus.io/protocols/resumable-upload.html#termination

packages/s3-store/README.md

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
## Install
2424

25-
In Node.js (16.0+), install with npm:
25+
In Node.js (20+), install with npm:
2626

2727
```bash
2828
npm install @tus/s3-store
@@ -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+
const { Server } = require("@tus/server");
35+
const { S3Store } = require("@tus/s3-store");
3636

3737
const 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+
const aws = require("aws-sdk");
203+
const { Server } = require("@tus/server");
204+
const { S3Store } = require("@tus/s3-store");
205205

206206
const 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({
242242
const s3Store = new S3Store({
243243
maxMultipartParts: 1000,
244244
// ...
245-
})
245+
});
246246
```
247247

248248
## Types
@@ -251,7 +251,7 @@ This package is fully typed with TypeScript.
251251

252252
## Compatibility
253253

254-
This package requires Node.js 16.0+.
254+
This package requires Node.js 20+.
255255

256256
## Contribute
257257

@@ -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

Comments
 (0)