{"_id":"xhr-status","_rev":"269119","name":"xhr-status","description":"Normalize XHR status code/text across various of environments","dist-tags":{"latest":"1.0.1"},"maintainers":[{"name":"3rdeden","email":""},{"name":"npm:3rdeden","email":""}],"time":{"modified":"2023-06-28T12:14:13.000Z","created":"2015-04-10T14:14:05.658Z","1.0.1":"2018-01-15T16:44:25.084Z","1.0.0":"2015-04-10T14:14:05.658Z"},"users":{},"author":{"name":"Arnout Kazemier"},"repository":{"type":"git","url":"git+https://github.com/unshiftio/xhr-status.git"},"versions":{"1.0.1":{"name":"xhr-status","version":"1.0.1","description":"Normalize XHR status code/text across various of environments","main":"index.js","scripts":{"100%":"istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100","test":"mocha test.js","watch":"mocha --watch test.js","coverage":"istanbul cover ./node_modules/.bin/_mocha -- test.js","test-travis":"istanbul cover node_modules/.bin/_mocha --report lcovonly -- test.js"},"repository":{"type":"git","url":"git+https://github.com/unshiftio/xhr-status.git"},"keywords":["status","statuscode","text","code","statustext","xhr"],"author":{"name":"Arnout Kazemier"},"license":"MIT","bugs":{"url":"https://github.com/unshiftio/xhr-status/issues"},"homepage":"https://github.com/unshiftio/xhr-status","devDependencies":{"assume":"1.x.x","istanbul":"0.x.x","mocha":"4.x.x","pre-commit":"1.x.x"},"gitHead":"afb3995b579dfa7c8f673ab1ade05a7b0e6b9352","_id":"xhr-status@1.0.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.1","_npmUser":{"name":"3rdeden","email":"npm@3rd-Eden.com"},"dist":{"shasum":"ad2c631886ccd98a92834ad0fe695b4cef8bac5c","size":3290,"noattachment":false,"key":"/xhr-status/-/xhr-status-1.0.1.tgz","tarball":"http://name.csiicloud.com:7001/xhr-status/download/xhr-status-1.0.1.tgz"},"maintainers":[{"name":"3rdeden","email":""},{"name":"npm:3rdeden","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/xhr-status-1.0.1.tgz_1516034664141_0.3129473130684346"},"directories":{},"publish_time":1516034665084,"_hasShrinkwrap":false,"_cnpm_publish_time":1516034665084,"_cnpmcore_publish_time":"2021-12-18T20:42:07.252Z"},"1.0.0":{"name":"xhr-status","version":"1.0.0","description":"Normalize XHR status code/text across various of environments","main":"index.js","scripts":{"100%":"istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100","test":"mocha test.js","watch":"mocha --watch test.js","coverage":"istanbul cover ./node_modules/.bin/_mocha -- test.js","test-travis":"istanbul cover node_modules/.bin/_mocha --report lcovonly -- test.js"},"repository":{"type":"git","url":"https://github.com/unshiftio/xhr-status"},"keywords":["status","statuscode","text","code","statustext","xhr"],"author":{"name":"Arnout Kazemier"},"license":"MIT","bugs":{"url":"https://github.com/unshiftio/xhr-status/issues"},"homepage":"https://github.com/unshiftio/xhr-status","devDependencies":{"assume":"1.2.x","istanbul":"0.3.x","mocha":"2.2.x","pre-commit":"1.0.x"},"gitHead":"b1c55cec0fea799fd6657e86667503a2776c2f54","_id":"xhr-status@1.0.0","_shasum":"9a8d1ec3aef486f76729c1ead7ddb54562d8f08f","_from":".","_npmVersion":"2.7.5","_nodeVersion":"0.10.35","_npmUser":{"name":"3rdeden","email":"npm@3rd-Eden.com"},"maintainers":[{"name":"3rdeden","email":""},{"name":"npm:3rdeden","email":""}],"dist":{"shasum":"9a8d1ec3aef486f76729c1ead7ddb54562d8f08f","size":3291,"noattachment":false,"key":"/xhr-status/-/xhr-status-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/xhr-status/download/xhr-status-1.0.0.tgz"},"directories":{},"publish_time":1428675245658,"_hasShrinkwrap":false,"_cnpm_publish_time":1428675245658,"_cnpmcore_publish_time":"2021-12-18T20:42:07.574Z"}},"readme":"# xhr-status\n\n[![Made by unshift][made-by]](http://unshift.io)[![Version npm][version]](http://browsenpm.org/package/xhr-status)[![Build Status][build]](https://travis-ci.org/unshiftio/xhr-status)[![Dependencies][david]](https://david-dm.org/unshiftio/xhr-status)[![Coverage Status][cover]](https://coveralls.io/r/unshiftio/xhr-status?branch=master)[![IRC channel][irc]](http://webchat.freenode.net/?channels=unshift)\n\n[made-by]: https://img.shields.io/badge/made%20by-unshift-00ffcc.svg?style=flat-square\n[version]: https://img.shields.io/npm/v/xhr-status.svg?style=flat-square\n[build]: https://img.shields.io/travis/unshiftio/xhr-status/master.svg?style=flat-square\n[david]: https://img.shields.io/david/unshiftio/xhr-status.svg?style=flat-square\n[cover]: https://img.shields.io/coveralls/unshiftio/xhr-status/master.svg?style=flat-square\n[irc]: https://img.shields.io/badge/IRC-irc.freenode.net%23unshift-00a8ff.svg?style=flat-square\n\nNormalize the XHR status codes across various of environments. This eliminates\nall the odd browser bugs that you might run in to while working with XHR\nrequests in browsers:\n\n- Captures thrown errors when accessing `statusText`\n- Normalizes the `1233` status code in Internet Explorer for `204` content.\n- Normalizes the `0` status code to `200` for `file://` requests.\n\n## Installation\n\nThe module is released in the public npm registry and can be installed by\nrunning:\n\n```\nnpm install --save xhr-status\n```\n\n## Usage\n\nThis module exports a single function. The returned function accepts one single\nargument which is a reference to the `xhr` instance that you've created. It will\nreturn an object with the following keys:\n\n- **code** The XHR status code.\n- **text** The XHR status text.\n\nSee for an implementation example:\n\n```js\n'use strict';\n\nvar xhrstatus = require('xhr-status')\n  , xhr = new XMLHTTPRequest.\n\nxhr.open('GET', 'http://google.com/gen_204', true);\nxhr.onload = function () {\n  var status = xhrstatus(xhr);\n\n  console.log(status.code) // 204\n  console.log(status.text) // OK\n};\n\nxhr.send();\n```\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/unshiftio/xhr-status","bugs":{"url":"https://github.com/unshiftio/xhr-status/issues"},"license":"MIT"}