lib/index.js
function Uploader(options) {

  if (typeof options !== 'object') {
    throw new TypeError('options must be an object');
  }

  this.$el = this._getElement(options.el);
  this._elType = this.$el.tagName.toLowerCase();

  //

  if (options.name && typeof options.name !== 'string') {
    throw new TypeError('options `name` must be a string');
  }

  if (options.url && typeof options.url !== 'string') {
    throw new TypeError('options `url` must be a string');
  }

  if (options.method && typeof options.method !== 'string') {
    throw new TypeError('options `method` must be a string');
  }

  if (options.headers && typeof options.headers !== 'object') {
    throw new TypeError('options `headers` must be an object');
  }

  //

  this.files = [];
  this.method = options.method || 'POST';
  this.name = options.name || 'file';
  this.url = options.url || null;
  this.headers = options.headers || {};

  // EE3

  EE3.call(this);

  // error listener

  this.on('error', this._onError.bind(this));

  // check support

  this._checkSupport();

  // attach to $el

  this._attach();

}
function Uploader(options) {

  if (typeof options !== 'object') {
    throw new TypeError('options must be an object');
  }

  this.$el = this._getElement(options.el);
  this._elType = this.$el.tagName.toLowerCase();

  //

  if (options.name && typeof options.name !== 'string') {
    throw new TypeError('options `name` must be a string');
  }

  if (options.url && typeof options.url !== 'string') {
    throw new TypeError('options `url` must be a string');
  }

  if (options.method && typeof options.method !== 'string') {
    throw new TypeError('options `method` must be a string');
  }

  if (options.headers && typeof options.headers !== 'object') {
    throw new TypeError('options `headers` must be an object');
  }

  //

  this.files = [];
  this.method = options.method || 'POST';
  this.name = options.name || 'file';
  this.url = options.url || null;
  this.headers = options.headers || {};

  // EE3

  EE3.call(this);

  // error listener

  this.on('error', this._onError.bind(this));

  // check support

  this._checkSupport();

  // attach to $el

  this._attach();

}
uploader 

@param options
@param options.el required. Can be a DOM reference or a CSS selector. Supported tags
are input (classic file input) or a div (for drag & drop)
@param options.name Name of the FormData param used for upload. Default: file
@param options.url URL of your server-side upload API endpoint. If omitted, calling upload()
will throw or emit and error
@param options.method Request method used during upload. Default: POST
@param options.headers object of headers to be set on the XHR object before sending
@constructor