{"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":{"integrity":"sha512-90Qzzu5SmR+ksmTPsc79121NZGtEiPvKACQLCl6yofknRx5xJI9kNj3oDVSX6dVTneF8Ju6+xpVFdDSzb7cNcg==","shasum":"4a680b1346747012927adbf9d9d2e18a42ca5eed","tarball":"http://registry-npm.ywwl.com/promise-resolve-timeout/download/promise-resolve-timeout-2.0.1.tgz","fileCount":5,"unpackedSize":3278,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFkRGYoL0FPT7ehNZCpCscPd2umk0ikXgMJoM6g5caGfAiAYtcRkAONlTxc6lTnw8+DqfQzIeBeYIGqkTCprmPQ2/A=="}],"size":1692,"noattachment":false,"key":"/promise-resolve-timeout/-/promise-resolve-timeout-2.0.1.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/promise-resolve-timeout_2.0.1_1736707102822_0.639145385798009"},"_hasShrinkwrap":false,"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","publish_time":1736707103018,"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_cnpm_publish_time":1736707103018,"dist-tags":{"latest":"2.0.1"}}