{
	"name": "xhr-request",
	"versions": {
		"1.0.0": {
			"name": "xhr-request",
			"version": "1.0.0",
			"description": "tiny http client for Node and the browser",
			"main": "index.js",
			"license": "MIT",
			"browser": {
				"./lib/request.js": "./lib/request-browser.js"
			},
			"author": {
				"name": "Matt DesLauriers",
				"email": "dave.des@gmail.com",
				"url": "https://github.com/mattdesl"
			},
			"dependencies": {
				"buffer-to-arraybuffer": "0.0.2",
				"object-assign": "^3.0.0",
				"query-string": "^2.4.0",
				"simple-get": "^1.4.3",
				"timed-out": "^2.0.0",
				"url-set-query": "^1.0.0",
				"xhr": "^2.0.4"
			},
			"devDependencies": {
				"faucet": "0.0.1",
				"hihat": "^2.4.3",
				"standard": "^5.1.1",
				"tape": "^4.0.1"
			},
			"scripts": {
				"test": "standard && npm run test-node && npm run test-browser",
				"test-node": "node test/index.js | faucet",
				"test-browser": "hihat test/test-browser.js --timeout=3000 --quit --print | faucet"
			},
			"keywords": [
				"node",
				"browser",
				"http",
				"got",
				"request",
				"gots",
				"nets",
				"xhr",
				"xmlhttprequest",
				"xml",
				"http",
				"request",
				"client",
				"https",
				"requests",
				"xml",
				"get",
				"query",
				"string"
			],
			"repository": {
				"type": "git",
				"url": "git://github.com/Jam3/xhr-request.git"
			},
			"homepage": "https://github.com/Jam3/xhr-request",
			"bugs": {
				"url": "https://github.com/Jam3/xhr-request/issues"
			},
			"gitHead": "0d8f8da75225fd89824a3e9c892851343de51a80",
			"_id": "xhr-request@1.0.0",
			"_shasum": "4b5d580dc0f45604ce65a98272bce35d7c705145",
			"_from": ".",
			"_npmVersion": "2.1.18",
			"_nodeVersion": "0.10.32",
			"_npmUser": {
				"name": "mattdesl",
				"email": "dave.des@gmail.com"
			},
			"dist": {
				"shasum": "4b5d580dc0f45604ce65a98272bce35d7c705145",
				"tarball": "https://registry.npmjs.org/xhr-request/-/xhr-request-1.0.0.tgz"
			},
			"maintainers": [
				{
					"name": "mattdesl",
					"email": "dave.des@gmail.com"
				}
			],
			"directories": {},
			"contributors": []
		},
		"1.0.1": {
			"name": "xhr-request",
			"version": "1.0.1",
			"description": "tiny http client for Node and the browser",
			"main": "index.js",
			"license": "MIT",
			"browser": {
				"./lib/request.js": "./lib/request-browser.js"
			},
			"author": {
				"name": "Matt DesLauriers",
				"email": "dave.des@gmail.com",
				"url": "https://github.com/mattdesl"
			},
			"dependencies": {
				"buffer-to-arraybuffer": "0.0.2",
				"object-assign": "^3.0.0",
				"query-string": "^2.4.0",
				"simple-get": "^1.4.3",
				"timed-out": "^2.0.0",
				"url-set-query": "^1.0.0",
				"xhr": "^2.0.4"
			},
			"devDependencies": {
				"faucet": "0.0.1",
				"hihat": "^2.4.3",
				"standard": "^5.1.1",
				"tape": "^4.0.1"
			},
			"scripts": {
				"test": "standard && npm run test-node && npm run test-browser",
				"test-node": "node test/index.js | faucet",
				"test-browser": "hihat test/test-browser.js --timeout=3000 --quit --print | faucet"
			},
			"keywords": [
				"node",
				"browser",
				"http",
				"got",
				"request",
				"gots",
				"nets",
				"xhr",
				"xmlhttprequest",
				"xml",
				"http",
				"request",
				"client",
				"https",
				"requests",
				"xml",
				"get",
				"query",
				"string"
			],
			"repository": {
				"type": "git",
				"url": "git://github.com/Jam3/xhr-request.git"
			},
			"homepage": "https://github.com/Jam3/xhr-request",
			"bugs": {
				"url": "https://github.com/Jam3/xhr-request/issues"
			},
			"gitHead": "45974a4a55a148a3686245e32bc2d9f550334b1f",
			"_id": "xhr-request@1.0.1",
			"_shasum": "83f08a4b20beec67a8c1c728e8102f4c9eecbdda",
			"_from": ".",
			"_npmVersion": "2.1.18",
			"_nodeVersion": "0.10.32",
			"_npmUser": {
				"name": "mattdesl",
				"email": "dave.des@gmail.com"
			},
			"dist": {
				"shasum": "83f08a4b20beec67a8c1c728e8102f4c9eecbdda",
				"tarball": "https://registry.npmjs.org/xhr-request/-/xhr-request-1.0.1.tgz"
			},
			"maintainers": [
				{
					"name": "mattdesl",
					"email": "dave.des@gmail.com"
				}
			],
			"directories": {},
			"contributors": []
		},
		"1.1.0": {
			"name": "xhr-request",
			"version": "1.1.0",
			"description": "tiny http client for Node and the browser",
			"main": "index.js",
			"license": "MIT",
			"browser": {
				"./lib/request.js": "./lib/request-browser.js"
			},
			"author": {
				"name": "Matt DesLauriers",
				"email": "dave.des@gmail.com",
				"url": "https://github.com/mattdesl"
			},
			"dependencies": {
				"buffer-to-arraybuffer": "^0.0.5",
				"object-assign": "^4.1.1",
				"query-string": "^5.0.1",
				"simple-get": "^2.7.0",
				"timed-out": "^4.0.1",
				"url-set-query": "^1.0.0",
				"xhr": "^2.0.4"
			},
			"devDependencies": {
				"budo": "^11.0.1",
				"faucet": "0.0.1",
				"standard": "^10.0.3",
				"tape": "^4.0.1"
			},
			"scripts": {
				"test": "standard && npm run test-node && npm run test-browser",
				"test-node": "node test/index.js | faucet",
				"test-browser": "budo test/test-browser.js -o"
			},
			"keywords": [
				"node",
				"browser",
				"http",
				"got",
				"request",
				"gots",
				"nets",
				"xhr",
				"xmlhttprequest",
				"xml",
				"http",
				"request",
				"client",
				"https",
				"requests",
				"xml",
				"get",
				"query",
				"string"
			],
			"repository": {
				"type": "git",
				"url": "git://github.com/Jam3/xhr-request.git"
			},
			"homepage": "https://github.com/Jam3/xhr-request",
			"bugs": {
				"url": "https://github.com/Jam3/xhr-request/issues"
			},
			"gitHead": "5154750cd3b178cd30d1f65fd955e68838f92b89",
			"_id": "xhr-request@1.1.0",
			"_npmVersion": "5.6.0",
			"_nodeVersion": "8.4.0",
			"_npmUser": {
				"name": "mattdesl",
				"email": "dave.des@gmail.com"
			},
			"dist": {
				"integrity": "sha512-Y7qzEaR3FDtL3fP30k9wO/e+FBnBByZeybKOhASsGP30NIkRAAkKD/sCnLvgEfAIEC1rcmK7YG8f4oEnIrrWzA==",
				"shasum": "f4a7c1868b9f198723444d82dcae317643f2e2ed",
				"tarball": "https://registry.npmjs.org/xhr-request/-/xhr-request-1.1.0.tgz"
			},
			"maintainers": [
				{
					"name": "mattdesl",
					"email": "dave.des@gmail.com"
				}
			],
			"_npmOperationalInternal": {
				"host": "s3://npm-registry-packages",
				"tmp": "tmp/xhr-request-1.1.0.tgz_1517679087679_0.745320345275104"
			},
			"directories": {},
			"contributors": []
		}
	},
	"time": {
		"modified": "2018-03-02T20:35:30.378Z",
		"created": "2015-09-01T22:44:02.206Z",
		"1.0.0": "2015-09-01T22:44:02.206Z",
		"1.0.1": "2015-09-02T14:42:31.559Z",
		"1.1.0": "2018-02-03T17:31:27.852Z"
	},
	"users": {},
	"dist-tags": {
		"latest": "1.1.0"
	},
	"_uplinks": {
		"npmjs": {
			"etag": "W/\"4d3c17512749078f7c22dce9074c1fda\"",
			"fetched": 1602009406667
		}
	},
	"_distfiles": {
		"xhr-request-1.0.0.tgz": {
			"url": "https://registry.npmjs.org/xhr-request/-/xhr-request-1.0.0.tgz",
			"sha": "4b5d580dc0f45604ce65a98272bce35d7c705145",
			"registry": "npmjs"
		},
		"xhr-request-1.0.1.tgz": {
			"url": "https://registry.npmjs.org/xhr-request/-/xhr-request-1.0.1.tgz",
			"sha": "83f08a4b20beec67a8c1c728e8102f4c9eecbdda",
			"registry": "npmjs"
		},
		"xhr-request-1.1.0.tgz": {
			"url": "https://registry.npmjs.org/xhr-request/-/xhr-request-1.1.0.tgz",
			"sha": "f4a7c1868b9f198723444d82dcae317643f2e2ed",
			"registry": "npmjs"
		}
	},
	"_attachments": {
		"xhr-request-1.1.0.tgz": {
			"shasum": "f4a7c1868b9f198723444d82dcae317643f2e2ed"
		}
	},
	"_rev": "17-d56c2b51cc7ef25a",
	"_id": "xhr-request",
	"readme": "# xhr-request\n\n[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\n\nAn extremely tiny HTTP/HTTPS request client for Node and the browser. Uses [xhr](https://www.npmjs.com/package/xhr) in the browser and [simple-get](https://www.npmjs.com/package/simple-get) in Node. \n\nSupported response types: JSON, ArrayBuffer, and text (default).\n\nFor streaming requests, you can just use [simple-get](https://www.npmjs.com/package/simple-get) directly. It works in Node/browser and supports true streaming in new versions of Chrome/FireFox.\n\n## Install\n\n```sh\nnpm install xhr-request --save\n```\n\n## Example\n\nA simple example, loading JSON:\n\n```js\nvar request = require('xhr-request')\n\nrequest('http://foo.com/some/api', {\n  json: true\n}, function (err, data) {\n  if (err) throw err\n  \n  // the JSON result\n  console.log(data.foo.bar)\n})\n```\n\nAnother example, sending a JSON `body` with a `query` parameter. Receives binary data as the response.\n\n```js\nvar request = require('xhr-request')\n\nrequest('http://foo.com/some/api', {\n  method: 'PUT',\n  json: true,\n  body: { foo: 'bar' },\n  responseType: 'arraybuffer',\n  query: {\n    sort: 'name'\n  }\n}, function (err, data) {\n  if (err) throw err\n  console.log('got ArrayBuffer result: ', data)\n})\n```\n\n## Motivation\n\nThere are a lot of HTTP clients, but most of them are Node-centric and lead to large browser bundles with builtins like `url`, `buffer`, `http`, `zlib`, streams, etc. \n\nWith browserify, this bundles to 7kb minified. Compare to 742kb for [request](https://www.npmjs.com/package/request), 153kb for [got](https://www.npmjs.com/package/got), 74kb for [simple-get](https://www.npmjs.com/package/simple-get), and 25kb for [nets](https://www.npmjs.com/package/nets).\n\n## Usage\n\n#### `req = xhrRequest(url, [opt], [callback])`\n\nSends a request to the given `url` with optional `opt` settings, triggering `callback` on complete.\n\nOptions:\n\n- `query` (String|Object)\n  - the query parameters to use for the URL\n- `headers` (Object)\n  - the headers for the request\n- `json` (Boolean) \n  - if true, `responseType` defaults to `'json`' and `body` will be sent as JSON\n- `responseType` (String)\n  - can be `'text'`, `'arraybuffer'` or `'json'`\n  - defaults to `'text'` unless `json` is true\n- `body` (String|JSON)\n  - an optional body to send with request\n  - sent as text unless `json` is true\n- `method` (String)\n  - an optional method to use, defaults to `'GET'`\n- `timeout` (Number)\n  - milliseconds to use as a timeout, defaults to 0 (no timeout)\n\nThe `callback` is called with the arguments `(error, data, response)`\n\n- `error` on success will be null/undefined\n- `data` the result of the request, either a JSON object, string, or `ArrayBuffer`\n- `response` the request response, see below\n\nThe response object has the following form:\n\n```js\n{\n  statusCode: Number,\n  method: String,\n  headers: {},\n  url: String,\n  rawRequest: {}\n}\n```\n\nThe `rawRequest` is the XMLHttpRequest in the browser, and the `http` response in Node.\n\nSince `opt` is optional, you can specify `callback` as the second argument.\n\n#### `req.abort()`\n\nThe returned `req` (the [ClientRequest](https://nodejs.org/api/http.html#http_class_http_clientrequest) or XMLHttpRequest) has an `abort()` method which can be used to cancel the request and send an Error to the callback.\n\n## See Also\n\n- [simple-get](https://www.npmjs.com/package/simple-get)\n- [xhr](https://www.npmjs.com/package/xhr)\n- [got](https://www.npmjs.com/package/got)\n- [nets](https://www.npmjs.com/package/nets)\n- [superagent](https://www.npmjs.com/package/nets)\n- [axios](https://www.npmjs.com/package/axios)\n\n## License\n\nMIT, see [LICENSE.md](http://github.com/Jam3/xhr-request/blob/master/LICENSE.md) for details."
}