-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
59 lines (59 loc) · 3.35 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{
"name": "request-replay",
"version": "0.2.0",
"description": "Replays a request when a network error occurs",
"main": "index.js",
"dependencies": {
"retry": "~0.6.0"
},
"devDependencies": {
"mocha": "~1.12.0",
"expect.js": "~0.2.0",
"request": "~2"
},
"scripts": {
"test": "mocha -R spec"
},
"repository": {
"type": "git",
"url": "git://github.com/IndigoUnited/node-request-replay"
},
"bugs": {
"url": "http://github.com/IndigoUnited/node-request-replay/issues"
},
"keywords": [
"retry",
"replay",
"request",
"mikeal",
"network"
],
"author": {
"name": "IndigoUnited",
"email": "hello@indigounited.com",
"url": "http://indigounited.com"
},
"license": "MIT",
"readme": "# request-replay [![Build Status](https://secure.travis-ci.org/IndigoUnited/node-request-replay.png)](http://travis-ci.org/IndigoUnited/node-request-replay.png)\n\nReplays a [request](https://github.com/mikeal/request) when a network error occurs using the [retry](https://github.com/felixge/node-retry) module.\n\n**DO NOT** use this module if you are piping `request` instances.\nIf you are listening to `data` events to buffer, beware that you must reset everything when a `replay` occurs.\nThis is why `pipping` is not supported.\n\n\n## Installation\n\n`$ npm install request-replay`\n\n\n## Usage\n\n```js\nvar fs = require('fs');\nvar request = require('request');\nvar replay = require('request-replay');\n\n// Note that the options argument is optional\n// Accepts the same options the retry module does and an additional\n// errorCodes array that default to ['EADDRINFO', 'ETIMEDOUT', 'ECONNRESET', 'ESOCKETTIMEDOUT']\nreplay(request('http://google.com/doodle.png', function (err, response, body) {\n // Do things\n}), {\n retries: 10,\n factor: 3\n})\n.on('replay', function (replay) {\n // \"replay\" is an object that contains some useful information\n console.log('request failed: ' + replay.error.code + ' ' + replay.error.message);\n console.log('replay nr: #' + replay.number);\n console.log('will retry in: ' + replay.delay + 'ms')\n})\n```\n\nNote that the default retry options are modified to be more appropriate for requests:\n\n* `retries`: The maximum amount of times to retry the operation. Default is `5`.\n* `factor`: The exponential factor to use. Default is `2`.\n* `minTimeout`: The amount of time before starting the first retry. Default is `2000`.\n* `maxTimeout`: The maximum amount of time between two retries. Default is `35000`.\n* `randomize`: Randomizes the timeouts by multiplying with a factor between `1` to `2`. Default is `true`.\n\n\n## License\n\nReleased under the [MIT License](http://www.opensource.org/licenses/mit-license.php).\n",
"readmeFilename": "README.md",
"_id": "request-replay@0.2.0",
"dist": {
"shasum": "9b693a5d118b39f5c596ead5ed91a26444057f60",
"tarball": "http://registry.npmjs.org/request-replay/-/request-replay-0.2.0.tgz"
},
"_from": "request-replay@>=0.2.0-0 <0.3.0-0",
"_npmVersion": "1.3.2",
"_npmUser": {
"name": "satazor",
"email": "andremiguelcruz@msn.com"
},
"maintainers": [
{
"name": "satazor",
"email": "andremiguelcruz@msn.com"
}
],
"directories": {},
"_shasum": "9b693a5d118b39f5c596ead5ed91a26444057f60",
"_resolved": "https://registry.npmjs.org/request-replay/-/request-replay-0.2.0.tgz"
}