{
  "name": "tolerance",
  "version": "1.0.0",
  "description": "This module wraps a function with retry functionality by passing a timeout. So the function will be more tolerant.",
  "private": false,
  "main": "index.js",
  "engines": {
    "node": ">=0.6.x",
    "npm": ">=1.1.x"
  },
  "directories": {},
  "dependencies": {
    "retry": ">=0.6.0"
  },
  "devDependencies": {
    "mocha": ">=1.0.1",
    "expect.js": ">=0.1.2"
  },
  "scripts": {
    "test": "mocha"
  },
  "repository": {
    "type": "git",
    "url": "git@github.com:adrai/tolerance.git"
  },
  "keywords": [
    "tolerance",
    "tolerate",
    "retry",
    "timeout",
    "wrap"
  ],
  "author": {
    "name": "adrai"
  },
  "maintainers": [
    {
      "name": "adrai",
      "email": "adriano@raiano.ch"
    }
  ],
  "homepage": "https://github.com/adrai/tolerance",
  "bugs": {
    "url": "https://github.com/adrai/tolerance/issues"
  },
  "license": {
    "type": "MIT",
    "url": "https://raw.github.com/adrai/tolerance/master/licence"
  },
  "readme": "**The world needs more TOLERANCE!!!**\n\n# Introduction\n\n[![Build Status](https://secure.travis-ci.org/adrai/tolerance.png)](http://travis-ci.org/adrai/tolerance)\n\nTolerance is a node.js module that wraps a function with retry functionality by passing a timeout. So the function will be more tolerant.\n\nYou can use it for example if you want to connect to a database that is not running immediately...\n\n# Installation\n\n    $ npm install tolerance\n\n# Usage\n\n\tvar tolerate = require('tolerance');\n\n\ttolerate(\n\t\tfunction(callback) {\n\t\t\tdb.connect(callback);\n\t\t},\n\t\t1500,\n\t\tfunction(err, res) {\n\t\t\t// If the db comes up after 800 ms\n\t\t\t// this callback will be called as the connection\n\t\t\t// would have been established immediately.\n\t\t\t//\n\t\t\t// If the db does not come up within the 1500 ms\n\t\t\t// this callback will be called with the appropriate error.\n\t\t\t//\n\t\t\t// In the background 'tolerance' will retry to connect to the db.\n\t\t}\n\t);\n\n\n## Use own retry indication\n\n\tvar tolerate = require('tolerance');\n\n\ttolerate(\n\t\tfunction(callback) {\n\t\t\tdb.connect(callback);\n\t\t},\n\t\t1500,\n\t\tfunction(err) { // should return true if you want to trigger a retry...\n\t\t\tif (err === 'not reached') {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\t\tfunction(err, res) {\n\t\t\t// If the db comes up after 800 ms\n\t\t\t// this callback will be called as the connection\n\t\t\t// would have been established immediately.\n\t\t\t//\n\t\t\t// If the db does not come up within the 1500 ms\n\t\t\t// this callback will be called with the appropriate error.\n\t\t\t//\n\t\t\t// In the background 'tolerance' will retry to connect to the db.\n\t\t}\n\t);\n\n# License\n\nCopyright (c) 2013 Adriano Raiano\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n",
  "readmeFilename": "README.md",
  "_id": "tolerance@1.0.0",
  "_shasum": "985168e5dd13c09ded414ac73866f847b408da6c",
  "_from": "tolerance@1.0.0",
  "_resolved": "https://registry.npmjs.org/tolerance/-/tolerance-1.0.0.tgz"
}
