Google Cloud Storage for @tus/server
npm install @tus/gcs-store@tus/gcs-store> 👉 Note: since 1.0.0 packages are split and published under the @tus scope. The
> old package, tus-node-server, is considered unstable and will only receive security
> fixes. Make sure to use the new packages.
- Install
- Use
- API
- new GCSStore(options)
- Types
- Compatibility
- Contribute
- License
In Node.js >=20.19.0, install with npm:
``bash`
npm install @tus/gcs-store
`js
const {Server} = require('@tus/server')
const {GCSStore} = require('@tus/gcs-store')
const {Storage} = require('@google-cloud/storage')
const storage = new Storage({keyFilename: 'key.json'})
const server = new Server({
path: '/files',
datastore: new GCSStore({
bucket: storage.bucket('tus-node-server-ci'),
}),
})
// ...
`
This package exports GCSStore. There is no default export.
Creates a new Google Cloud Storage store by passing a GCS bucket instance.
#### options.bucket
The bucket instance
The tus protocol supports optional [extensions][]. Below is a table of the supported
extensions in @tus/gcs-store.
| Extension | @tus/gcs-store |
| ------------------------ | ---------------- |
| [Creation][] | ✅ |
| [Creation With Upload][] | ✅ |
| [Expiration][] | ❌ |
| [Checksum][] | ❌ |
| [Termination][] | ❌ |
| [Concatenation][] | ❌ |
This package is fully typed with TypeScript.
This package requires Node.js >=20.19.0.
See
contributing.md`.
[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
[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