{"name":"promise-timeout","version":"1.1.1","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","repository":{"type":"git","url":"git+https://github.com/building5/promise-timeout.git"},"devDependencies":{"mocha":"^3.2.0"},"gitHead":"de04470e6c802ee2849d011fcf2ee140368d2c43","bugs":{"url":"https://github.com/building5/promise-timeout/issues"},"homepage":"https://github.com/building5/promise-timeout#readme","_id":"promise-timeout@1.1.1","_shasum":"9d3f0c834411a17ea81786e0355f7cdf1ecf5597","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.4","_npmUser":{"name":"leedm777","email":"leedm777@yahoo.com"},"maintainers":[{"name":"leedm777","email":"leedm777@yahoo.com"}],"dist":{"shasum":"9d3f0c834411a17ea81786e0355f7cdf1ecf5597","tarball":"http://registry-npm.ywwl.com/promise-timeout/download/promise-timeout-1.1.1.tgz","integrity":"sha512-pM00yVjcSNGxVWiAFUMa6Yv0YbHqT8zRw/9q/N4DAFAfmmdoMZSMU1F+3Mnn7KyuD9NRXnZ/7OTlChC1vY0Ckg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxmHqfUHZnwcPp57R0YjduvbTULHGE3HgGK/qN7eVYpwIhALaoKJ5Fv1ZI7D+sjjDi3yh8apswADdHD2oH4PSx/5qm"}],"size":2561,"noattachment":false,"key":"/promise-timeout/-/promise-timeout-1.1.1.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/promise-timeout-1.1.1.tgz_1490132672526_0.19347943481989205"},"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":1490132674493,"_cnpm_publish_time":1490132674493,"dist-tags":{"latest":"1.3.0"}}