Skip to content

Commit d0fef39

Browse files
authored
Improve all README's (#360)
1 parent 585f425 commit d0fef39

File tree

5 files changed

+216
-43
lines changed

5 files changed

+216
-43
lines changed

README.md

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -97,30 +97,23 @@ fastify.listen(3000, (err) => {
9797

9898
## Packages
9999

100-
- [`@tus/server`][]. The tus server. Standalone or integrate it into your Node.js server. Supports events and hooks for monitering and validation.
100+
- [`@tus/server`][]. The tus server. Standalone or integrate it into your Node.js server.
101101
- [`@tus/file-store`][]. Store files on disk.
102102
- [`@tus/s3-store`][]. Store files on AWS S3.
103103
- [`@tus/gcs-store`][]. Store files on Google Cloud Storage.
104104

105105
## Extensions
106106

107-
The tus protocol supports optional [extensions][]:
107+
The tus protocol supports optional [extensions][]. Below is a table of the supported extensions.
108108

109-
- [Creation][]. Create an upload.
110-
- [Creation With Upload][]. Include part of the upload in the initial request, rather than in subsequent `PATCH` request(s).
111-
- [Expiration][]. The Server MAY remove unfinished uploads once they expire.
112-
- [Checksum][]. Verify data integrity of each `PATCH` request.
113-
- [Termination][]. Allow clients to terminate (`DELETE`) completed and unfinished uploads allowing the Server to free up used resources.
114-
- [Concatenation][]. Concatenate multiple uploads into a single one enabling Clients to perform parallel uploads and to upload non-contiguous chunks
115-
116-
| Extension | [`file-store`][`@tus/file-store`] | [`s3-store`][`@tus/s3-store`] | [`gcs-store`][`@tus/gcs-store`] |
117-
| -------------------- | --------------------------------- | ----------------------------- | ------------------------------- |
118-
| Creation ||||
119-
| Creation With Upload ||||
120-
| Expiration ||||
121-
| Checksum ||||
122-
| Termination ||||
123-
| Concatenation ||||
109+
| Extension | [`file-store`][`@tus/file-store`] | [`s3-store`][`@tus/s3-store`] | [`gcs-store`][`@tus/gcs-store`] |
110+
| ------------------------ | --------------------------------- | ----------------------------- | ------------------------------- |
111+
| [Creation][] ||||
112+
| [Creation With Upload][] ||||
113+
| [Expiration][] ||||
114+
| [Checksum][] ||||
115+
| [Termination][] ||||
116+
| [Concatenation][] ||||
124117

125118
## Demos
126119

@@ -168,9 +161,9 @@ See [`contributing.md`](https://github.com/tus/tus-node-server/blob/main/.github
168161
[`@tus/s3-store`]: https://github.com/tus/tus-node-server/tree/main/packages/s3-store
169162
[`@tus/gcs-store`]: https://github.com/tus/tus-node-server/tree/main/packages/gcs-store
170163
[extensions]: https://tus.io/protocols/resumable-upload.html#protocol-extensions
171-
[Creation]: https://tus.io/protocols/resumable-upload.html#creation
172-
[Creation With Upload]: https://tus.io/protocols/resumable-upload.html#creation-with-upload
173-
[Expiration]: https://tus.io/protocols/resumable-upload.html#expiration
174-
[Checksum]: https://tus.io/protocols/resumable-upload.html#checksum
175-
[Termination]: https://tus.io/protocols/resumable-upload.html#termination
176-
[Concatenation]: https://tus.io/protocols/resumable-upload.html#concatenation
164+
[creation]: https://tus.io/protocols/resumable-upload.html#creation
165+
[creation with upload]: https://tus.io/protocols/resumable-upload.html#creation-with-upload
166+
[expiration]: https://tus.io/protocols/resumable-upload.html#expiration
167+
[checksum]: https://tus.io/protocols/resumable-upload.html#checksum
168+
[termination]: https://tus.io/protocols/resumable-upload.html#termination
169+
[concatenation]: https://tus.io/protocols/resumable-upload.html#concatenation

packages/file-store/README.md

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- [Use](#use)
1111
- [API](#api)
1212
- [`new FileStore(options)`](#new-filestoreoptions)
13+
- [Extensions](#extensions)
1314
- [Examples](#examples)
1415
- [Example: creating your own config store](#example-creating-your-own-config-store)
1516
- [Types](#types)
@@ -46,13 +47,35 @@ This package exports `FileStore`. There is no default export.
4647

4748
Creates a new file store with options.
4849

49-
#### `directory`
50+
#### `options.directory`
5051

51-
The directory to store the files on disk.
52+
The directory to store the files on disk (`string`).
5253

53-
#### `configstore`
54+
#### `options.configstore`
5455

55-
Provide your own storage solution for the metadata of uploads. Default uses [`configstore`](https://www.npmjs.com/package/configstore).
56+
Provide your own storage solution for the metadata of uploads (`Class`).
57+
58+
Default uses [`configstore`](https://www.npmjs.com/package/configstore).
59+
60+
#### `options.expirationPeriodInMilliseconds`
61+
62+
The time before an _ongoing_ upload is considered expired (`number`).
63+
64+
This is since the time of creation, not modification. Once an upload is considered expired,
65+
uploads can be removed with [`cleanUpExpiredUploads`](https://github.com/tus/tus-node-server/tree/main/packages/server#)#servercleanupexpireduploads
66+
67+
## Extensions
68+
69+
The tus protocol supports optional [extensions][]. Below is a table of the supported extensions in `@tus/file-store`.
70+
71+
| Extension | `@tus/file-store` |
72+
| ------------------------ | ----------------- |
73+
| [Creation][] ||
74+
| [Creation With Upload][] ||
75+
| [Expiration][] ||
76+
| [Checksum][] ||
77+
| [Termination][] ||
78+
| [Concatenation][] ||
5679

5780
## Examples
5881

@@ -108,3 +131,11 @@ See [`contributing.md`](https://github.com/tus/tus-node-server/blob/main/.github
108131
## License
109132

110133
[MIT](https://github.com/tus/tus-node-server/blob/master/license) © [tus](https://github.com/tus)
134+
135+
[extensions]: https://tus.io/protocols/resumable-upload.html#protocol-extensions
136+
[creation]: https://tus.io/protocols/resumable-upload.html#creation
137+
[creation with upload]: https://tus.io/protocols/resumable-upload.html#creation-with-upload
138+
[expiration]: https://tus.io/protocols/resumable-upload.html#expiration
139+
[checksum]: https://tus.io/protocols/resumable-upload.html#checksum
140+
[termination]: https://tus.io/protocols/resumable-upload.html#termination
141+
[concatenation]: https://tus.io/protocols/resumable-upload.html#concatenation

packages/gcs-store/README.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,31 @@ This package exports `GCSStore`. There is no default export.
4848

4949
Creates a new Google Cloud Storage store with options.
5050

51-
#### `projectId`
51+
#### `options.projectId`
5252

5353
The GCS project ID (`string`).
5454

55-
#### `keyFilename`
55+
#### `options.keyFilename`
5656

5757
Path to the keyfile with credentials (`string`).
5858

59-
#### `bucket`
59+
#### `options.bucket`
6060

6161
The bucket name.
6262

63+
## Extensions
64+
65+
The tus protocol supports optional [extensions][]. Below is a table of the supported extensions in `@tus/gcs-store`.
66+
67+
| Extension | `@tus/gcs-store` |
68+
| ------------------------ | ---------------- |
69+
| [Creation][] ||
70+
| [Creation With Upload][] ||
71+
| [Expiration][] ||
72+
| [Checksum][] ||
73+
| [Termination][] ||
74+
| [Concatenation][] ||
75+
6376
## Types
6477

6578
This package is fully typed with TypeScript.
@@ -75,3 +88,11 @@ See [`contributing.md`](https://github.com/tus/tus-node-server/blob/main/.github
7588
## License
7689

7790
[MIT](https://github.com/tus/tus-node-server/blob/master/license) © [tus](https://github.com/tus)
91+
92+
[extensions]: https://tus.io/protocols/resumable-upload.html#protocol-extensions
93+
[creation]: https://tus.io/protocols/resumable-upload.html#creation
94+
[creation with upload]: https://tus.io/protocols/resumable-upload.html#creation-with-upload
95+
[expiration]: https://tus.io/protocols/resumable-upload.html#expiration
96+
[checksum]: https://tus.io/protocols/resumable-upload.html#checksum
97+
[termination]: https://tus.io/protocols/resumable-upload.html#termination
98+
[concatenation]: https://tus.io/protocols/resumable-upload.html#concatenation

packages/s3-store/README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- [Use](#use)
1111
- [API](#api)
1212
- [`new S3Store(options)`](#new-s3storeoptions)
13+
- [Extensions](#extensions)
1314
- [Examples](#examples)
1415
- [Example: using `credentials` to fetch credentials inside a AWS container](#example-using-credentials-to-fetch-credentials-inside-a-aws-container)
1516
- [Types](#types)
@@ -56,16 +57,29 @@ Creates a new AWS S3 store with options.
5657
> All options except for `bucket` and `partSize` are directly passed to the S3 client.
5758
> This means you can also provide alternative authentication properties, such as [credentials](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Credentials.html#constructor-property).
5859
59-
#### `bucket`
60+
#### `options.bucket`
6061

6162
The bucket name.
6263

63-
#### `partSize`
64+
#### `options.partSize`
6465

6566
The preferred part size for parts send to S3. Can not be lower than 5MB or more than 500MB.
6667
The server calculates the optimal part size, which takes this size into account,
6768
but may increase it to not exceed the S3 10K parts limit.
6869

70+
## Extensions
71+
72+
The tus protocol supports optional [extensions][]. Below is a table of the supported extensions in `@tus/s3-store`.
73+
74+
| Extension | `@tus/s3-store` |
75+
| ------------------------ | --------------- |
76+
| [Creation][] ||
77+
| [Creation With Upload][] ||
78+
| [Expiration][] ||
79+
| [Checksum][] ||
80+
| [Termination][] ||
81+
| [Concatenation][] ||
82+
6983
## Examples
7084

7185
### Example: using `credentials` to fetch credentials inside a AWS container
@@ -108,3 +122,11 @@ See [`contributing.md`](https://github.com/tus/tus-node-server/blob/main/.github
108122
## License
109123

110124
[MIT](https://github.com/tus/tus-node-server/blob/master/license) © [tus](https://github.com/tus)
125+
126+
[extensions]: https://tus.io/protocols/resumable-upload.html#protocol-extensions
127+
[creation]: https://tus.io/protocols/resumable-upload.html#creation
128+
[creation with upload]: https://tus.io/protocols/resumable-upload.html#creation-with-upload
129+
[expiration]: https://tus.io/protocols/resumable-upload.html#expiration
130+
[checksum]: https://tus.io/protocols/resumable-upload.html#checksum
131+
[termination]: https://tus.io/protocols/resumable-upload.html#termination
132+
[concatenation]: https://tus.io/protocols/resumable-upload.html#concatenation

0 commit comments

Comments
 (0)