package
Dedicated listening for xhr requests.
npm install loadsGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Loads is a small helper library which automatically assigns and listens to the various of XHR event hooks and emits the corrected and normalized responses over a supplied EventEmitter instance.
This module was primary developed with browsers in mind and is released in the public npm registry. It can be installed by running:
npm install --save loadsvar loads = require('loads')
, xhr = new XMLHTTPRequest()
, EventEmitter = require('events').EventEmitter;
var ee = new EventEmitter();
loads(xhr, ee);
ee.on('stream', function (data) {
// data chunk received.
});
ee.on('end', function () {});
xhr.open(url);
xhr.send();Estimated unpacked size across 6 packages.
12.0 kB
Includes dependencies.
4 direct · 1 outdated