{"name":"promise-timeout","version":"1.3.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","repository":{"type":"git","url":"git+https://github.com/building5/promise-timeout.git"},"devDependencies":{"mocha":"^3.2.0"},"gitHead":"4a09650f9e8935324844f283014836c9bc2d98d7","bugs":{"url":"https://github.com/building5/promise-timeout/issues"},"homepage":"https://github.com/building5/promise-timeout#readme","_id":"promise-timeout@1.3.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"leedm777","email":"leedm777@yahoo.com"},"maintainers":[{"name":"leedm777","email":"leedm777@yahoo.com"}],"dist":{"integrity":"sha512-5yANTE0tmi5++POym6OgtFmwfDvOXABD9oj/jLQr5GPEyuNEb7jH4wbbANJceJid49jwhi1RddxnhnEAb/doqg==","shasum":"d1c78dd50a607d5f0a5207410252a3a0914e1014","tarball":"http://registry-npm.ywwl.com/promise-timeout/download/promise-timeout-1.3.0.tgz","fileCount":6,"unpackedSize":6089,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIErpaMZvpSnySgDEXW+hyO/G8Pcr07MXSkn34Rxp9OuJAiEAwdqCtarlLtrqJocA00V22BTAj6qfpOhTRN9xMV1FV7Y="}],"size":2685,"noattachment":false,"key":"/promise-timeout/-/promise-timeout-1.3.0.tgz"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/promise-timeout_1.3.0_1518969762912_0.6634729544890283"},"_hasShrinkwrap":false,"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":1518969763006,"_cnpm_publish_time":1518969763006,"dist-tags":{"latest":"1.3.0"}}