1.0.0 • Published 5 years ago

uploadman v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

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);