{"name":"promise-timeout","version":"1.0.0","description":"Simple timeouts for promises","main":"index.js","scripts":{"test":"mocha"},"keywords":["promise","timeout"],"author":{"name":"David M. Lee, II","email":"leedm777@yahoo.com"},"license":"MIT","devDependencies":{"mocha":"^2.3.4"},"gitHead":"5abcfb0e92e1f27bba4e276330d7ed7fd1b5d0f8","_id":"promise-timeout@1.0.0","_shasum":"18c960a6e9d3671d49025edbfbb8c9c9bafaaa52","_from":".","_npmVersion":"3.4.0","_nodeVersion":"4.2.2","_npmUser":{"name":"leedm777","email":"leedm777@yahoo.com"},"maintainers":[{"name":"leedm777","email":"leedm777@yahoo.com"}],"dist":{"shasum":"18c960a6e9d3671d49025edbfbb8c9c9bafaaa52","tarball":"http://registry-npm.ywwl.com/promise-timeout/download/promise-timeout-1.0.0.tgz","integrity":"sha512-wtUvtu/CqQAIdjLpQDyNFV+S2mAGoutF0/U8eKShGBb77cKSQpY7m8r/onmM957dFKzJu0cack/vGOe0tsXBRA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCR/b/H9YqYiJHDRnrimGSNB909sliVkvSvZxGVeKihjQIhAI+/WuRrNBhFjU0crNduIR9A6KJRVJ2VDM3I0ryPOyZh"}],"size":2238,"noattachment":false,"key":"/promise-timeout/-/promise-timeout-1.0.0.tgz"},"directories":{},"readme":"# promise-timeout\n\nA super-simple way to put a timeout on promise resolution.\n\nIt assumes you already have either platform support for promises (Node 0.12 or\ngreater), or you have a polyfill (see [es6-promise][]).\n\n## Installation\n\n```bash\n$ npm install promise-timeout\n```\n\n## Usage\n\n### timeout(promise, timeoutMillis)\n\nRejects a promise with a `TimeoutError` if it does not settle within the\nspecified timeout. Parameters:\n\n * `promise: Promise` - Promise to monitor.\n * `timeoutMillis: number` - Number of milliseconds to wait on settling.\n\n## TimeoutError\n\nException indicating that the timeout expired.\n\n## Examples\n\nES2015:\n\n```javascript\nimport { timeout, TimeoutError } from 'promise-timeout';\n\nlet somePromise = goDoSomething();\n\ntimeout(somePromise, 1000)\n  .then((thing) => console.log('I did a thing!'))\n  .catch((err) => {\n    if (err instanceof TimeoutError) {\n      console.error('Timeout :-(');\n    }\n  });\n```\n\nES5:\n\n```javascript\n'use strict';\n\nvar pt = require('promise-timeout');\n\nvar somePromise = goDoSomething();\n\npt.timeout(somePromise, 1000)\n  .then(function (thing) {\n    console.log('I did a thing!');\n  }).catch(function (err) {\n    if (err instanceof pt.TimeoutError) {\n      console.error('Timeout :-(');\n    }\n  });\n```\n\n [es6-promise]: https://www.npmjs.com/package/es6-promise\n","publish_time":1447872477545,"_cnpm_publish_time":1447872477545,"dist-tags":{"latest":"1.3.0"}}