{"_id":"promise-resolve-timeout","_rev":"3757947","name":"promise-resolve-timeout","description":"Create a Promise which will resolve with the provided value after a timeout.","dist-tags":{"latest":"2.0.1"},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"time":{"modified":"2025-03-18T07:12:36.000Z","created":"2019-08-27T16:10:41.547Z","2.0.1":"2025-01-12T18:38:23.018Z","2.0.0":"2022-04-07T19:06:18.550Z","1.2.1":"2020-03-22T16:12:59.185Z","1.2.0":"2019-08-28T23:44:08.703Z","1.1.0":"2019-08-27T18:04:12.844Z","1.0.0":"2019-08-27T16:10:41.547Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/fabiospampinato/promise-resolve-timeout.git"},"versions":{"2.0.1":{"name":"promise-resolve-timeout","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/promise-resolve-timeout.git"},"description":"Create a Promise which will resolve with the provided value after a timeout.","license":"MIT","version":"2.0.1","type":"module","main":"dist/index.js","exports":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"clean":"tsex clean","compile":"tsex compile","compile:watch":"tsex compile --watch","test":"tsex test","test:watch":"tsex test --watch","prepublishOnly":"tsex prepare"},"keywords":["promise","resolve","timeout"],"devDependencies":{"fava":"^0.3.4","tsex":"^4.0.2","typescript":"^5.7.3"},"_id":"promise-resolve-timeout@2.0.1","gitHead":"c1bcde9c7736fb707cf8ec404e726683d5a11179","bugs":{"url":"https://github.com/fabiospampinato/promise-resolve-timeout/issues"},"homepage":"https://github.com/fabiospampinato/promise-resolve-timeout#readme","_nodeVersion":"18.19.0","_npmVersion":"10.2.3","dist":{"shasum":"4a680b1346747012927adbf9d9d2e18a42ca5eed","size":1692,"noattachment":false,"key":"/promise-resolve-timeout/-/promise-resolve-timeout-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/promise-resolve-timeout/download/promise-resolve-timeout-2.0.1.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/promise-resolve-timeout_2.0.1_1736707102822_0.639145385798009"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-01-12T18:38:23.018Z","publish_time":1736707103018,"_source_registry_name":"default","_cnpm_publish_time":1736707103018},"2.0.0":{"name":"promise-resolve-timeout","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/promise-resolve-timeout.git"},"description":"Create a Promise which will resolve with the provided value after a timeout.","version":"2.0.0","type":"module","main":"dist/index.js","exports":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"clean":"tsex clean","compile":"tsex compile","compile:watch":"tsex compile --watch","test":"tsex test","test:watch":"tsex test --watch","prepublishOnly":"npm run clean && npm run compile && npm run test"},"keywords":["promise","resolve","timeout"],"devDependencies":{"fava":"^0.0.6","tsex":"^1.1.0","typescript":"^4.6.3"},"gitHead":"f84d9de93124a69c027e5d216087525144cd7fec","bugs":{"url":"https://github.com/fabiospampinato/promise-resolve-timeout/issues"},"homepage":"https://github.com/fabiospampinato/promise-resolve-timeout#readme","_id":"promise-resolve-timeout@2.0.0","_nodeVersion":"16.13.0","_npmVersion":"8.1.0","dist":{"shasum":"6f3022c9a27b0916fbeca4492759c4b71539212a","size":2418,"noattachment":false,"key":"/promise-resolve-timeout/-/promise-resolve-timeout-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/promise-resolve-timeout/download/promise-resolve-timeout-2.0.0.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/promise-resolve-timeout_2.0.0_1649358378353_0.0431982899470118"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-04-07T19:13:19.708Z","publish_time":1649358378550,"_cnpm_publish_time":1649358378550},"1.2.1":{"name":"promise-resolve-timeout","description":"Create a Promise which will resolve with the provided value after a timeout.","version":"1.2.1","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage .nyc_output","clean":"npm run clean:dist && npm run clean:coverage","compile":"tsc --skipLibCheck && tstei","compile:watch":"tsc --skipLibCheck --watch","test":"ava","test:watch":"ava --watch","coverage":"nyc --reporter=html ava","report":"nyc report","report:html":"open coverage/index.html","prepublishOnly":"npm run clean && npm run compile && npm run coverage"},"ava":{"files":["test/index.js"]},"bugs":{"url":"https://github.com/fabiospampinato/promise-resolve-timeout/issues"},"license":"MIT","author":{"name":"Fabio Spampinato","email":"spampinabio@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/fabiospampinato/promise-resolve-timeout.git"},"keywords":["promise","resolve","timeout"],"dependencies":{},"devDependencies":{"@types/node":"^12.7.2","ava":"^2.3.0","ava-spec":"^1.1.1","nyc":"^14.1.1","rimraf":"^3.0.0","typescript":"^3.5.3","typescript-transform-export-interop":"^1.0.2"},"gitHead":"30acadfeae1894329211f0a5492df984643df0e5","homepage":"https://github.com/fabiospampinato/promise-resolve-timeout#readme","_id":"promise-resolve-timeout@1.2.1","_npmVersion":"6.4.1","_nodeVersion":"8.4.0","_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"dist":{"shasum":"314847fea7e40e54fd093ff84236e47194eb7945","size":3203,"noattachment":false,"key":"/promise-resolve-timeout/-/promise-resolve-timeout-1.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/promise-resolve-timeout/download/promise-resolve-timeout-1.2.1.tgz"},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/promise-resolve-timeout_1.2.1_1584893579025_0.9544107117028566"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-24T18:03:13.440Z","publish_time":1584893579185,"_cnpm_publish_time":1584893579185},"1.2.0":{"name":"promise-resolve-timeout","description":"Create a Promise which will resolve with the provided value after a timeout.","version":"1.2.0","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage .nyc_output","clean":"npm run clean:dist && npm run clean:coverage","compile":"tsc --skipLibCheck && tstei","compile:watch":"tsc --skipLibCheck --watch","test":"ava","test:watch":"ava --watch","coverage":"nyc --reporter=html ava","report":"nyc report","report:html":"open coverage/index.html","prepublishOnly":"npm run clean && npm run compile && npm run coverage"},"ava":{"files":["test/index.js"]},"bugs":{"url":"https://github.com/fabiospampinato/promise-resolve-timeout/issues"},"license":"MIT","author":{"name":"Fabio Spampinato","email":"spampinabio@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/fabiospampinato/promise-resolve-timeout.git"},"keywords":["promise","resolve","timeout"],"dependencies":{},"devDependencies":{"@types/node":"^12.7.2","ava":"^2.3.0","ava-spec":"^1.1.1","nyc":"^14.1.1","rimraf":"^3.0.0","typescript":"^3.5.3","typescript-transform-export-interop":"^1.0.2"},"gitHead":"f5a28c6e796e005f2ebb0b35511a49269162a7c7","homepage":"https://github.com/fabiospampinato/promise-resolve-timeout#readme","_id":"promise-resolve-timeout@1.2.0","_npmVersion":"6.4.1","_nodeVersion":"8.4.0","_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"dist":{"shasum":"3cbd219dd36cb17431dbb6e0cb50e8795bb911cb","size":3065,"noattachment":false,"key":"/promise-resolve-timeout/-/promise-resolve-timeout-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/promise-resolve-timeout/download/promise-resolve-timeout-1.2.0.tgz"},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/promise-resolve-timeout_1.2.0_1567035848544_0.60208133535598"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-24T18:03:13.334Z","publish_time":1567035848703,"_cnpm_publish_time":1567035848703},"1.1.0":{"name":"promise-resolve-timeout","description":"Create a Promise which will resolve with the provided value after a timeout.","version":"1.1.0","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage .nyc_output","clean":"npm run clean:dist && npm run clean:coverage","compile":"tsc --skipLibCheck && tstei","compile:watch":"tsc --skipLibCheck --watch","test":"ava","test:watch":"ava --watch","coverage":"nyc --reporter=html ava","report":"nyc report","report:html":"open coverage/index.html","prepublishOnly":"npm run clean && npm run compile && npm run coverage"},"ava":{"files":["test/index.js"]},"bugs":{"url":"https://github.com/fabiospampinato/promise-resolve-timeout/issues"},"license":"MIT","author":{"name":"Fabio Spampinato","email":"spampinabio@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/fabiospampinato/promise-resolve-timeout.git"},"keywords":["promise","resolve","timeout"],"dependencies":{},"devDependencies":{"@types/node":"^12.7.2","ava":"^2.3.0","ava-spec":"^1.1.1","nyc":"^14.1.1","rimraf":"^3.0.0","typescript":"^3.5.3","typescript-transform-export-interop":"^1.0.2"},"gitHead":"6c357bc6fbc8c426011bcc5ce7ae65ac3c4458b2","homepage":"https://github.com/fabiospampinato/promise-resolve-timeout#readme","_id":"promise-resolve-timeout@1.1.0","_npmVersion":"6.4.1","_nodeVersion":"8.4.0","_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"dist":{"shasum":"e41023dea82c12448d29ff38090c7cc2a41593f8","size":2823,"noattachment":false,"key":"/promise-resolve-timeout/-/promise-resolve-timeout-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/promise-resolve-timeout/download/promise-resolve-timeout-1.1.0.tgz"},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/promise-resolve-timeout_1.1.0_1566929052714_0.016619395255436986"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-24T18:03:12.478Z","publish_time":1566929052844,"_cnpm_publish_time":1566929052844},"1.0.0":{"name":"promise-resolve-timeout","description":"Create a Promise which will resolve with the provided value after a timeout.","version":"1.0.0","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"clean:dist":"rimraf dist","clean:coverage":"rimraf coverage .nyc_output","clean":"npm run clean:dist && npm run clean:coverage","compile":"tsc --skipLibCheck && tstei","compile:watch":"tsc --skipLibCheck --watch","test":"ava","test:watch":"ava --watch","coverage":"nyc --reporter=html ava","report":"nyc report","report:html":"open coverage/index.html","prepublishOnly":"npm run clean && npm run compile && npm run coverage"},"ava":{"files":["test/index.js"]},"bugs":{"url":"https://github.com/fabiospampinato/promise-resolve-timeout/issues"},"license":"MIT","author":{"name":"Fabio Spampinato","email":"spampinabio@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/fabiospampinato/promise-resolve-timeout.git"},"keywords":["promise","resolve","timeout"],"dependencies":{},"devDependencies":{"@types/node":"^12.7.2","ava":"^2.3.0","ava-spec":"^1.1.1","nyc":"^14.1.1","rimraf":"^3.0.0","typescript":"^3.5.3","typescript-transform-export-interop":"^1.0.2"},"gitHead":"36b04fabbb26fd2ff3884eea11bd468f2042ff5c","homepage":"https://github.com/fabiospampinato/promise-resolve-timeout#readme","_id":"promise-resolve-timeout@1.0.0","_npmVersion":"6.4.1","_nodeVersion":"8.4.0","_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"dist":{"shasum":"690cb02d689bdc600ecd7bcf1e3c1b37b85ae89c","size":2643,"noattachment":false,"key":"/promise-resolve-timeout/-/promise-resolve-timeout-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/promise-resolve-timeout/download/promise-resolve-timeout-1.0.0.tgz"},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/promise-resolve-timeout_1.0.0_1566922241368_0.1888589925570352"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-24T18:03:11.604Z","publish_time":1566922241547,"_cnpm_publish_time":1566922241547}},"readme":"# Promise Resolve Timeout\n\nCreate a Promise which will resolve with the provided value after a timeout.\n\n## Install\n\n```sh\nnpm install promise-resolve-timeout\n```\n\n## Usage\n\nIf the passed value is a function it will be called and its return value will be the resolved value, otherwise the passed value is the resolved value.\n\n```ts\nimport resolveTimeout from 'promise-resolve-timeout';\n\n// Defaulting to a default value when racing promises\n\nPromise.race ([\n  resolveTimeout ( 1000, false ), // Resolving after 1000ms\n  resolveTimeout ( 5000, () => 'foo' ), // Resolving after 5000ms\n  new Promise ( () => {\n    // Something...\n  });\n]);\n\n// Delaying\n\nresolveTimeout ( 1000 ) // Waiting 1000ms\n  .then ( () => {\n    // Something...\n  });\n```\n\n## License\n\nMIT © Fabio Spampinato\n","_attachments":{},"homepage":"https://github.com/fabiospampinato/promise-resolve-timeout#readme","bugs":{"url":"https://github.com/fabiospampinato/promise-resolve-timeout/issues"},"license":"MIT"}