This package, `tus` (version 0.1.7), provides a Node.js middleware for Express and Connect applications, implementing the tus resumable upload protocol. Originally designed for older versions of Express and Connect, it allows clients to pause and resume file uploads, making it suitable for large files or unreliable network conditions. The package's last update was nine years ago, making it effectively abandoned and incompatible with modern Node.js ecosystems, recent Express/Connect versions, and current JavaScript module standards (ESM). It lacks active maintenance, security patches, and contemporary features found in actively developed alternatives like `tus-node-server`. Its release cadence was sporadic, reflecting a period of early development for the tus protocol itself.
npm install tusVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to set up the `tus` middleware with Express, configure the upload directory, set a maximum file size, and handle the `complete` callback for finished uploads.
Migrate to an actively maintained tus server implementation, such as `tus-node-server`, which supports modern Node.js and Express versions. This will require a complete re-implementation of the server-side upload logic.
If used in an older CommonJS environment, stick to `require()`. For modern projects using ESM, this package is fundamentally incompatible and requires migration to an ESM-compatible alternative.
Always ensure `res.status(200).send('OK')` or a similar response mechanism is called within the `complete` callback to properly terminate the HTTP transaction.Discontinue use of this package immediately in any production or security-sensitive environment. Replace it with a currently maintained and regularly updated tus server implementation.
Ensure `const tus = require('tus');` is correct and `tus.createServer` is being invoked with valid options, returning a middleware function.Run `npm install tus` in your project directory to install the package.
Update your Express response handling in the `complete` callback to `res.status(200).send('OK')` or `res.sendStatus(200)` for simple status codes.Ensure the user running the Node.js application has read and write permissions to the configured upload `directory`.