{"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":{"integrity":"sha512-r/rZgXMml7o+kZXb5YMQBPPk9rNeC5S8L/B3j1272v8g7cg4k9AC8IbL3zCbPlUXy4Z99Tli3A4g4SYSoHBCmw==","shasum":"690cb02d689bdc600ecd7bcf1e3c1b37b85ae89c","tarball":"http://registry-npm.ywwl.com/promise-resolve-timeout/download/promise-resolve-timeout-1.0.0.tgz","fileCount":9,"unpackedSize":5228,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdZVYCCRA9TVsSAnZWagAAK0UP/AwGXxUL3naExe4ceXK7\nV+XEiQ1nYMj6/8rmpQboP73yZ15adfvO67dGIwl5wVigmcQoZjfLlL+Kfs16\n08B0Hf9o0NJT5Vz8vxLP3PD8J18pFVbNcwirEU9hdFE1JeDrH8xXYtbHGecI\n2IOAT62Jy4OP4Urm36k3ahccjUGsHwuQ3mK8h5VA1+D2/2NrFU0pYB2YYGQk\nmEW4RE6teTXhXyntAgEbOD1Sj8msbhwzQtqWWeSgjYFUppL23Fm774GMVmSG\nPwKe73kAw6n34BtagU5jxDA5AH5Swp3s6iEvPeqtRBkKJdLSepDWOnkNbC+z\n56kPaQasWPr3J/WBdmtkZet5MewB9vw7kp/Y8rT2L8YEHmk/+C2zomw+LMOX\nhUUR9ibAMWR/VU2WpQNlV7rucTTlWYhHlJGNW6gwh/snmpyF8o5KpDc8kn53\n5g/GCy+9SwUy2y1/LepJGnveFP8GwMAiOguBELpqOjLbNBM4rnEmZrJQ09IS\nrR4eWhmqc/mKSUKT+8xGJr8ypgoFmaeFjUEHmxU4rgT9c8PtL/wJIOeGA4jd\nSO6p/cBU6FwLhBhmxKFjuVe5W0PBIFB4k0dgcjC1DxWhvGmsOOCgdUdgQ87j\n0KlnLtnrQS74sUXrbb+o4qF7aVdyJ2A+3xodfpNlQKgpKVUAzepeQI6X4c2Y\nOrl7\r\n=liIJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA7s0oUBCDmV4fPaYx8ScVjHV5zKKh2iLWGSWaqdM3PiAiEApX77Jjnmci1SVkCHFTpepjpTen0aia8Uj+/KIsbhOf0="}],"size":2643,"noattachment":false,"key":"/promise-resolve-timeout/-/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,"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 --save 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":1566922241547,"_cnpm_publish_time":1566922241547,"dist-tags":{"latest":"2.0.1"}}