JSPM

xhr-progress

0.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 36
  • Score
    100M100P100Q66257F
  • License MIT

Get progress updates for your XMLHttpRequests where supported.

Package Exports

  • xhr-progress

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (xhr-progress) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

xhr-progress experimental

Get progress updates for your XMLHttpRequests where supported.

Usage

xhr-progress

progress(xhr)

Returns an EventEmitter that emits progress events for the XMLHttpRequest passed into the first argument.

progress.on('data', handler(amount, total))

Emitted for each progress update. amount is a number between 0 and 1 representing how much of the request has been completed. total is the total size of the request.

If progress events are not available, total will default to null, and this event will be emitted once the request is complete with an amount of 1.

progress.on('end', handler())

Called when the request is complete.

License

MIT. See LICENSE.md for details.