# xhr-response

> Safely extract the XHR response from your XHR instance.

Latest version **1.0.1** (published 2015-05-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install xhr-response
pnpm add xhr-response
yarn add xhr-response
bun add xhr-response
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2015-05-06 |
| First published | 2015-03-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Arnout Kazemier |
| Maintainers | 3rdeden |
| Keywords | xhr, response, body, data, responseText, responseXML, XMLHTTPRequest, request |

## Links

- npm: https://www.npmjs.com/package/xhr-response
- Repository: https://github.com/unshiftio/xhr-response
- Issues: https://github.com/unshiftio/xhr-response/issues
- npm.io page: https://npm.io/package/xhr-response

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2015-05-06
- 1.0.0 — 2015-03-24

## README

# xhr-response

[![Made by unshift][made-by]](http://unshift.io)[![Version npm][version]](http://browsenpm.org/package/xhr-response)[![Build Status][build]](https://travis-ci.org/unshiftio/xhr-response)[![Dependencies][david]](https://david-dm.org/unshiftio/xhr-response)[![Coverage Status][cover]](https://coveralls.io/r/unshiftio/xhr-response?branch=master)[![IRC channel][irc]](http://webchat.freenode.net/?channels=unshift)

[made-by]: https://img.shields.io/badge/made%20by-unshift-00ffcc.svg?style=flat-square
[version]: https://img.shields.io/npm/v/xhr-response.svg?style=flat-square
[build]: https://img.shields.io/travis/unshiftio/xhr-response/master.svg?style=flat-square
[david]: https://img.shields.io/david/unshiftio/xhr-response.svg?style=flat-square
[cover]: https://img.shields.io/coveralls/unshiftio/xhr-response/master.svg?style=flat-square
[irc]: https://img.shields.io/badge/IRC-irc.freenode.net%23unshift-00a8ff.svg?style=flat-square

The `xhr-response` is a small helper library for safely extracting response data
from XHR requests. There are some minor bugs in browsers which can cause
exceptions to be thrown when accessing the wrong properties of an XHR request
instance. This module works around these bugs. 

## Installation

This module is primary written for client-side code which use the commonjs
module pattern for exporting.

```
npm install --save xhr-response
```

## Usage

It's just as simple as:

```js
var response = require("xhr-response");

var xhr = new XMLHTTPRequest();
// .. stuffs ..

xhr.onload = function () {
  var data = response(xhr);

  console.log('data', data);
};
```

## License

MIT

---
_Source: https://npm.io/package/xhr-response · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
