Skip to content
form upload and progress api
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore
.travis.yml
History.md
LICENSE
Readme.md
component.json
index.js
package.json

Readme.md

submit

form upload and progress api

Build Status Dependency Status NPM version

Installation

npm install submit

Usage: submit(form).to(path)

Submit the form form to the path path.

The result is a Promises/A+ promise with the addition of a small subset of the event emitter API that only supports progress events which can be handled by calling .on('progress', (e) => ...)

var submit = require('submit');
submit(form).to('/upload')
  .on('progress', function (e) {
    console.log(e.percent + '%');
  })
  .then(function (res) {
    console.log('complete')
  }, function (err) {
    console.log('error')
  })
  .done();
}

License

MIT

Something went wrong with that request. Please try again.