-
Notifications
You must be signed in to change notification settings - Fork 318
Blogpost on tus.io
Main content:
- no GUI, only an API
- replaces tus-jquery-client
- (modern) browser support
Structure:
- 1.0 was just released
- rewrite and update of SDKs
- new js-client
- supports resumability and and progress events
- integration with npm and without a package manager
- replaces jquery-client
- bla, blab, …
After releasing the first production-ready version of the tus protocol, we still have another announcement we would like to share with the world: During the last months, we have not only improved the protocol and added long requested features, we also spent a lot of time with proper implementations. This resulted in a full rewrite of tusd, a tus server written in Go. In the same breath we want to announce a new and officially maintained client library, called tus-js-client. It is meant for the use in web applications and enables simple integration using a few lines of code:
input.addEventListener("change", function(e) {
// Get the selected file from the input element
var file = e.target.files[0]
// Create a new tus upload
var upload = new tus.Upload(file, {
endpoint: "http://localhost:1080/files/",
onSuccess: function() {
console.log("Download %s from %s", upload.file.name, upload.url)
}
})
// Start the upload
upload.start()
})
The JavaScript client library supports, both, resumable uploads and progress events out of the box without any additional setup, while depending on no runtime-dependecy and staying as light-weight as possible. You can install it by simple, including the file using a script tag:
<script src="http://tus.io/assets/tus-js-client.min.js"></script>
or by consuming NPM or similar packet managers. For more information about this topic, please have a look at the appropriate documentation.
Packed with all these features, the new JavaScript library replaces the old tus-jquery-client, which was introduced along with the first drafts of our protocol. The problem with latter project is that - as you can probably guess by looking at its name - it depended on jQuery. Without doubt, jQuery makes a developer's life easier and allows extremely simple code but it's costs was not worth the use in our library. In the end we decided to drop this big dependency and introduce a new, lightweight and simple project: tus-js-client was born.