uploadman
v1.0.0
Published
A lightweight AJAX upload library.
Downloads
3
Readme
Uploadman
A lightweight AJAX upload library.
Installation
This is a Node.js module available through the npm registry.
Before installing, download and install Node.js. Node.js 8.0 or higher is required.
Installation is done using the
npm install
command:
$ npm install uploadman
Usage
import
import upload from 'uploadman';
// or:
const upload = require('uploadman');
case
import upload from 'uploadman';
const options = {
headers: Object,
withCredentials: Boolean,
file: Object,
data: Object,
filename: String,
action: String,
onProgress: e => {
console.log(~~e.percent);
},
onSuccess: res => {
console.log('success');
},
onError: err => {
console.log('error');
}
};
upload(options);