Skip to content

Commit c61bb66

Browse files
committed
Undo formatting
1 parent 4523e10 commit c61bb66

File tree

6 files changed

+191
-172
lines changed

6 files changed

+191
-172
lines changed

README.md

Lines changed: 10 additions & 9 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
@@ -144,7 +144,8 @@ 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]: https://tus.io/protocols/resumable-upload.html#creation-with-upload
147+
[creation with upload]:
148+
https://tus.io/protocols/resumable-upload.html#creation-with-upload
148149
[expiration]: https://tus.io/protocols/resumable-upload.html#expiration
149150
[checksum]: https://tus.io/protocols/resumable-upload.html#checksum
150151
[termination]: https://tus.io/protocols/resumable-upload.html#termination

packages/azure-store/README.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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

@@ -98,12 +98,17 @@ 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]: https://tus.io/protocols/resumable-upload.html#creation-with-upload
101+
[creation with upload]:
102+
https://tus.io/protocols/resumable-upload.html#creation-with-upload
102103
[expiration]: https://tus.io/protocols/resumable-upload.html#expiration
103104
[checksum]: https://tus.io/protocols/resumable-upload.html#checksum
104105
[termination]: https://tus.io/protocols/resumable-upload.html#termination
105106
[concatenation]: https://tus.io/protocols/resumable-upload.html#concatenation
106-
[`cleanUpExpiredUploads`]: https://github.com/tus/tus-node-server/tree/main/packages/server#cleanupexpireduploads
107+
[`cleanUpExpiredUploads`]:
108+
https://github.com/tus/tus-node-server/tree/main/packages/server#cleanupexpireduploads
107109
[kvstores]: https://github.com/tus/tus-node-server/tree/main/packages/server#kvstores
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
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

packages/file-store/README.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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
```
@@ -138,11 +138,14 @@ 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]: https://tus.io/protocols/resumable-upload.html#creation-with-upload
141+
[creation with upload]:
142+
https://tus.io/protocols/resumable-upload.html#creation-with-upload
142143
[expiration]: https://tus.io/protocols/resumable-upload.html#expiration
143144
[checksum]: https://tus.io/protocols/resumable-upload.html#checksum
144145
[termination]: https://tus.io/protocols/resumable-upload.html#termination
145146
[concatenation]: https://tus.io/protocols/resumable-upload.html#concatenation
146-
[`cleanUpExpiredUploads`]: https://github.com/tus/tus-node-server/tree/main/packages/server#cleanupexpireduploads
147+
[`cleanUpExpiredUploads`]:
148+
https://github.com/tus/tus-node-server/tree/main/packages/server#cleanupexpireduploads
147149
[kvstores]: https://github.com/tus/tus-node-server/tree/main/packages/server#kvstores
148-
[`KvStore`]: https://github.com/tus/tus-node-server/blob/main/packages/utils/src/kvstores/Types.ts
150+
[`KvStore`]:
151+
https://github.com/tus/tus-node-server/blob/main/packages/utils/src/kvstores/Types.ts

packages/gcs-store/README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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

@@ -88,7 +88,8 @@ 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]: https://tus.io/protocols/resumable-upload.html#creation-with-upload
91+
[creation with upload]:
92+
https://tus.io/protocols/resumable-upload.html#creation-with-upload
9293
[expiration]: https://tus.io/protocols/resumable-upload.html#expiration
9394
[checksum]: https://tus.io/protocols/resumable-upload.html#checksum
9495
[termination]: https://tus.io/protocols/resumable-upload.html#termination

packages/s3-store/README.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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
@@ -265,12 +265,16 @@ 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]: https://tus.io/protocols/resumable-upload.html#creation-with-upload
268+
[creation with upload]:
269+
https://tus.io/protocols/resumable-upload.html#creation-with-upload
269270
[expiration]: https://tus.io/protocols/resumable-upload.html#expiration
270271
[checksum]: https://tus.io/protocols/resumable-upload.html#checksum
271272
[termination]: https://tus.io/protocols/resumable-upload.html#termination
272273
[concatenation]: https://tus.io/protocols/resumable-upload.html#concatenation
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
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
275278
[kvstores]: https://github.com/tus/tus-node-server/tree/main/packages/server#kvstores
276-
[`KvStore`]: https://github.com/tus/tus-node-server/blob/main/packages/utils/src/kvstores/Types.ts
279+
[`KvStore`]:
280+
https://github.com/tus/tus-node-server/blob/main/packages/utils/src/kvstores/Types.ts

0 commit comments

Comments
 (0)