# tus

> Node.js resumable upload middleware for express/connect

Latest version **0.1.7** (published 2014-07-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install tus
pnpm add tus
yarn add tus
bun add tus
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.7 |
| Published | 2014-07-25 |
| First published | 2014-06-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Niklas von Hertzen |
| Maintainers | niklasvh |
| Keywords | tus, upload, resumable, connect, express |

## Links

- npm: https://www.npmjs.com/package/tus
- Repository: https://github.com/niklasvh/tus
- Issues: https://github.com/niklasvh/tus/issues
- npm.io page: https://npm.io/package/tus

## Dependencies (1)

- [bluebird](https://npm.io/package/bluebird.md) ^2.1.3

## Recent versions

- 0.1.7 (latest) — 2014-07-25
- 0.1.6 — 2014-07-09
- 0.1.5 — 2014-07-05
- 0.1.4 — 2014-07-05
- 0.1.3 — 2014-07-05
- 0.1.2 — 2014-07-05
- 0.1.1 — 2014-07-04
- 0.1.0 — 2014-06-27

## README

# node-tus

[![Build Status](https://travis-ci.org/niklasvh/node-tus.png)](https://travis-ci.org/niklasvh/node-tus)
[![NPM Downloads](https://img.shields.io/npm/dm/tus.svg)](https://www.npmjs.org/package/tus)
[![NPM Version](https://img.shields.io/npm/v/tus.svg)](https://www.npmjs.org/package/tus)

Node.js resumable upload middleware for [express](http://expressjs.com/)/[connect](https://github.com/senchalabs/connect) implementing the [tus resumable upload protocol](http://tus.io/protocols/resumable-upload.html).

## Installation

    $ npm install tus

## Usage

To attach the resumable upload middleware to express or connect, create an upload server by calling `createServer` passing it an `options` object. Available options are:

 - **directory** - String - Path where to upload the files (required)
 - **maxFileSize** - Number - Maximum file size for uploads, in bytes (optional)
 - **complete** - Function - Callback to inform when a file (all chunks) have been uploaded. Passes the request and response streams, with the metadata assigned to the `upload` property within the request. The response must be handled manually if a complete callback is used. (optional)
 - **path** - String - Override path to be returned for Location header when creating new files, for example if you proxy forward requests to a different host/path (optional)
 
Example:

```js
var express = require("express"),
    upload = require("tus");

var app = express();
var port = 3000;

app.use("/files", upload.createServer({
    directory: __dirname + "/uploads",
    maxFileSize: 1024 * 1024 * 5 // 5 mb,
    complete: function(req, res, next) {
        console.log("File uploaded with the following metadata:", req.upload);
        res.send(200);
    }
}));

app.listen(port);
```

## Running Tests

    $ npm test

## License

Licensed under the MIT license.

---
_Source: https://npm.io/package/tus · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
