Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ concurrency: ${{ github.workflow }}--${{ github.ref }}

jobs:
main:
name: Node.js LTS
name: Node.js 20
runs-on: ubuntu-latest

steps:
Expand All @@ -33,7 +33,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
node-version: 20

- name: Install dependencies
run: npm ci --no-fund --no-audit
Expand Down
21 changes: 10 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ A standalone server which stores files on disk.
> Try it yourself in [StackBlitz](https://stackblitz.com/edit/stackblitz-starters-zg6mgnuf?file=index.js)

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

const host = '127.0.0.1'
const port = 1080
const host = "127.0.0.1";
const port = 1080;
const server = new Server({
path: '/files',
datastore: new FileStore({directory: './files'}),
})
path: "/files",
datastore: new FileStore({ directory: "./files" }),
});

server.listen({host, port})
server.listen({ host, port });
```

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

## Compatibility

All packages require Node.js 16.0+.
All packages require Node.js 20+.

## Contribute

Expand All @@ -144,8 +144,7 @@ See
[`@tus/azure-store`]: https://github.com/tus/tus-node-server/tree/main/packages/azure-store
[extensions]: https://tus.io/protocols/resumable-upload.html#protocol-extensions
[creation]: https://tus.io/protocols/resumable-upload.html#creation
[creation with upload]:
https://tus.io/protocols/resumable-upload.html#creation-with-upload
[creation with upload]: https://tus.io/protocols/resumable-upload.html#creation-with-upload
[expiration]: https://tus.io/protocols/resumable-upload.html#expiration
[checksum]: https://tus.io/protocols/resumable-upload.html#checksum
[termination]: https://tus.io/protocols/resumable-upload.html#termination
Expand Down
23 changes: 11 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 13 additions & 18 deletions packages/azure-store/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Azure Store based on the Append Blob Client [Azure Blob AppendBlobClient](https:

## Install

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

```bash
npm install @tus/azure-store
Expand All @@ -25,17 +25,17 @@ npm install @tus/azure-store
## Use

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

const server = new Server({
path: '/files',
path: "/files",
datastore: new AzureStore({
account: process.env.AZURE_ACCOUNT_ID,
accountKey: process.env.AZURE_ACCOUNT_KEY,
containerName: process.env.AZURE_CONTAINER_NAME,
account: process.env.AZURE_ACCOUNT_ID,
accountKey: process.env.AZURE_ACCOUNT_KEY,
containerName: process.env.AZURE_CONTAINER_NAME,
}),
})
});
// ...
```

Expand Down Expand Up @@ -84,7 +84,7 @@ This package is fully typed with TypeScript.

## Compatibility

This package requires Node.js 16.0+.
This package requires Node.js 20+.

## Contribute

Expand All @@ -98,17 +98,12 @@ See

[extensions]: https://tus.io/protocols/resumable-upload.html#protocol-extensions
[creation]: https://tus.io/protocols/resumable-upload.html#creation
[creation with upload]:
https://tus.io/protocols/resumable-upload.html#creation-with-upload
[creation with upload]: https://tus.io/protocols/resumable-upload.html#creation-with-upload
[expiration]: https://tus.io/protocols/resumable-upload.html#expiration
[checksum]: https://tus.io/protocols/resumable-upload.html#checksum
[termination]: https://tus.io/protocols/resumable-upload.html#termination
[concatenation]: https://tus.io/protocols/resumable-upload.html#concatenation
[`cleanUpExpiredUploads`]:
https://github.com/tus/tus-node-server/tree/main/packages/server#cleanupexpireduploads
[`cleanUpExpiredUploads`]: https://github.com/tus/tus-node-server/tree/main/packages/server#cleanupexpireduploads
[kvstores]: https://github.com/tus/tus-node-server/tree/main/packages/server#kvstores
[`KvStore`]:
https://github.com/tus/tus-node-server/blob/main/packages/utils/src/kvstores/Types.ts

[`MemoryKvStore`]:
https://github.com/tus/tus-node-server/blob/main/packages/utils/src/kvstores/MemoryKvStore.ts
[`KvStore`]: https://github.com/tus/tus-node-server/blob/main/packages/utils/src/kvstores/Types.ts
[`MemoryKvStore`]: https://github.com/tus/tus-node-server/blob/main/packages/utils/src/kvstores/MemoryKvStore.ts
2 changes: 1 addition & 1 deletion packages/azure-store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
"should": "^13.2.3"
},
"engines": {
"node": ">=16"
"node": ">=20"
}
}
35 changes: 16 additions & 19 deletions packages/file-store/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

## Install

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

```bash
npm install @tus/file-store
Expand All @@ -29,13 +29,13 @@ npm install @tus/file-store
## Use

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

const server = new Server({
path: '/files',
datastore: new FileStore({directory: './some/path'}),
})
path: "/files",
datastore: new FileStore({ directory: "./some/path" }),
});
// ...
```

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

```ts
import type {Upload} from '@tus/server'
import type { Upload } from "@tus/server";

export class MemoryConfigstore {
data: Map<string, Upload> = new Map()
data: Map<string, Upload> = new Map();

get(key: string): Upload | undefined {
return this.data.get(key)
return this.data.get(key);
}

set(key: string, value: Upload) {
this.data.set(key, value)
this.data.set(key, value);
}

delete(key: string) {
return this.data.delete(key)
return this.data.delete(key);
}

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

## Compatibility

This package requires Node.js 16.0+.
This package requires Node.js 20+.

## Contribute

Expand All @@ -138,14 +138,11 @@ See

[extensions]: https://tus.io/protocols/resumable-upload.html#protocol-extensions
[creation]: https://tus.io/protocols/resumable-upload.html#creation
[creation with upload]:
https://tus.io/protocols/resumable-upload.html#creation-with-upload
[creation with upload]: https://tus.io/protocols/resumable-upload.html#creation-with-upload
[expiration]: https://tus.io/protocols/resumable-upload.html#expiration
[checksum]: https://tus.io/protocols/resumable-upload.html#checksum
[termination]: https://tus.io/protocols/resumable-upload.html#termination
[concatenation]: https://tus.io/protocols/resumable-upload.html#concatenation
[`cleanUpExpiredUploads`]:
https://github.com/tus/tus-node-server/tree/main/packages/server#cleanupexpireduploads
[`cleanUpExpiredUploads`]: https://github.com/tus/tus-node-server/tree/main/packages/server#cleanupexpireduploads
[kvstores]: https://github.com/tus/tus-node-server/tree/main/packages/server#kvstores
[`KvStore`]:
https://github.com/tus/tus-node-server/blob/main/packages/utils/src/kvstores/Types.ts
[`KvStore`]: https://github.com/tus/tus-node-server/blob/main/packages/utils/src/kvstores/Types.ts
2 changes: 1 addition & 1 deletion packages/file-store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
"@redis/client": "^1.6.0"
},
"engines": {
"node": ">=16"
"node": ">=20"
}
}
21 changes: 10 additions & 11 deletions packages/gcs-store/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

## Install

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

```bash
npm install @tus/gcs-store
Expand All @@ -26,19 +26,19 @@ npm install @tus/gcs-store
## Use

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

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

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

const server = new Server({
path: '/files',
path: "/files",
datastore: new GCSStore({
bucket: storage.bucket('tus-node-server-ci'),
bucket: storage.bucket("tus-node-server-ci"),
}),
})
});
// ...
```

Expand Down Expand Up @@ -74,7 +74,7 @@ This package is fully typed with TypeScript.

## Compatibility

This package requires Node.js 16.0+.
This package requires Node.js 20+.

## Contribute

Expand All @@ -88,8 +88,7 @@ See

[extensions]: https://tus.io/protocols/resumable-upload.html#protocol-extensions
[creation]: https://tus.io/protocols/resumable-upload.html#creation
[creation with upload]:
https://tus.io/protocols/resumable-upload.html#creation-with-upload
[creation with upload]: https://tus.io/protocols/resumable-upload.html#creation-with-upload
[expiration]: https://tus.io/protocols/resumable-upload.html#expiration
[checksum]: https://tus.io/protocols/resumable-upload.html#checksum
[termination]: https://tus.io/protocols/resumable-upload.html#termination
Expand Down
2 changes: 1 addition & 1 deletion packages/gcs-store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@
"@google-cloud/storage": "*"
},
"engines": {
"node": ">=16"
"node": ">=20"
}
}
Loading