Socket
Socket
Sign inDemoInstall

loads

Package Overview
Dependencies
4
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.3 to 0.0.4

LICENSE

13

index.js

@@ -112,3 +112,3 @@ 'use strict';

if (xhr.readyState >= 3 && status.code === 200 && (data = response(xhr))) {
ee.emit('stream', data);
ee.emit('stream', data, status);
}

@@ -129,4 +129,13 @@ };

if (status.code < 100 || status.code > 599) return onerror(evt);
if (data) ee.emit('stream', data);
//
// There is a bug in FireFox's XHR2 implementation where status code 204
// triggers a "no element found" error and bad data. So to be save here,
// we're just **never** going to emit a `stream` event as for 204's there
// shouldn't be any content.
//
if (data && status.code !== 204) {
ee.emit('stream', data, status);
}
ee.emit('end', undefined, status);

@@ -133,0 +142,0 @@ });

6

package.json
{
"name": "loads",
"version": "0.0.3",
"version": "0.0.4",
"description": "Dedicated listening for xhr requests.",

@@ -31,3 +31,3 @@ "main": "index.js",

"dependencies": {
"failure": "1.0.x",
"failure": "1.1.x",
"one-time": "0.0.x",

@@ -42,4 +42,4 @@ "xhr-response": "1.0.x",

"mocha": "2.2.x",
"pre-commit": "1.0.x"
"pre-commit": "1.1.x"
}
}
# loads
[![Made by unshift][made-by]](http://unshift.io)[![Version
npm][version]](http://browsenpm.org/package/loads)[![Build
Status][build]](https://travis-ci.org/unshiftio/loads)[![Dependencies][david]](https://david-dm.org/unshiftio/loads)[![Coverage
Status][cover]](https://coveralls.io/r/unshiftio/loads?branch=master)[![IRC channel][irc]](http://webchat.freenode.net/?channels=unshift)
[![Made by unshift][made-by]](http://unshift.io)[![Version npm][version]](http://browsenpm.org/package/loads)[![Build Status][build]](https://travis-ci.org/unshiftio/loads)[![Dependencies][david]](https://david-dm.org/unshiftio/loads)[![Coverage Status][cover]](https://coveralls.io/r/unshiftio/loads?branch=master)[![IRC channel][irc]](https://webchat.freenode.net/?channels=unshift)

@@ -15,4 +12,4 @@ [made-by]: https://img.shields.io/badge/made%20by-unshift-00ffcc.svg?style=flat-square

Loads is a small helper library which automatically assign and listen to the
various of XHR event hooks and emit the corrected and normalized responses over
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.

@@ -40,3 +37,3 @@

ee.on('stream', function (data) {
// data chunks received.
// data chunk received.
});

@@ -52,2 +49,2 @@

MIT
[MIT](LICENSE)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc