{"name":"@iocmd/hold-up","version":"1.1.2","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"setInterval with promises, counter and error handling","homepage":"http://github.com/iocmd/hold-up","main":"lib/hold-up.js","repository":{"type":"git","url":"git://github.com/iocmd/hold-up.git"},"keywords":["timeout","interval","promise","async","await","try-catch","try"],"scripts":{"test":"madrun test","coverage":"madrun coverage","lint":"madrun lint","fix:lint":"madrun fix:lint","report":"madrun report","watcher":"madrun watcher","watch:test":"madrun watch:test","watch:lint":"madrun watch:lint","watch:tape":"madrun watch:tape","watch:coverage:base":"madrun watch:coverage:base","watch:coverage:tape":"madrun watch:coverage:tape","watch:coverage":"madrun watch:coverage"},"dependencies":{"try-to-catch":"^3.0.0"},"license":"MIT","devDependencies":{"@cloudcmd/stub":"^2.3.1","coveralls":"^3.0.2","eslint":"^6.1.0","eslint-plugin-node":"^11.0.0","eslint-plugin-putout":"^3.0.0","madrun":"^5.0.0","nodemon":"^2.0.2","nyc":"^15.0.0","putout":"^7.0.2","redrun":"^7.0.0","supertape":"^1.2.3"},"engines":{"node":">=8"},"publishConfig":{"access":"public"},"gitHead":"c6f1086c3d9db5ca04aa77652410fe5b7c3b5c00","bugs":{"url":"https://github.com/iocmd/hold-up/issues"},"_id":"@iocmd/hold-up@1.1.2","_nodeVersion":"13.9.0","_npmVersion":"6.12.1","dist":{"integrity":"sha512-kbPRKIojDyIdrHIE1bKkhwQgk3uC/1sQXa2E4kKWia4S6k6DtpI0U9Juc0RAZQIVIOYRpN84WAROmoh4k8w/cw==","shasum":"e0e2b8445302be9be19b8e291fc7c7582c40117b","tarball":"http://registry-npm.ywwl.com/@iocmd/hold-up/download/@iocmd/hold-up-1.1.2.tgz","fileCount":5,"unpackedSize":7013,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeVT/ACRA9TVsSAnZWagAAyqgP/R08TckNfK7aVAvIGCa3\n0p3g9VZEsCyugZUz6yS9pNCtXFAlxlqpRk0aBET8hvBPOobuehpJ/g/eXlBh\n+ldfj09cyEqtHXNtUD1exfW3yitO0OioJQwDxjTtdVWkzjb6GuMTiRqM8pgP\n8eg3efhjFTebWjFOIm3tRbbt1W4ZMtnrnCTPMiEe+H3N8Koh3Dk7HFaTYRjh\nhIhWn8wt/wOJLYsCTlCj9/0CVWW5I1BPfxtFnPOYKs/56iMQPYzpWZXU/O74\n7EXzkI3CESgu+zMzDMcnKXtoUySpi5s773ebkRluQBsj9vz5SHo0cx+kxiVe\nSL2SlrJr/hrWFoBJXFZcCR1axPP0RBTvx6tn/gYt/bdoocIaZu6WC6VKdv+T\npN6ky8zDxeomzUIdwcaJ8SbwofdB+ChzED64DdlCtFkBJQ0L21b5ieTPPs+C\ntJh0Cl4eUbSxEY55L56qdY6+tIvm11/nRSv1ErTSoCX02a3EsEMeC7vY1MqP\ngcSdhFlLVBuRPdCtfiY4A+yvXSGWA1q5hHh5bQOIT1zh2KUc2Yk6Rc61Uv+H\nZ8oBNTUYpQ4pyMAh9IvMgrFV9yWXlbC7S7om0rM83Jlq3i51JFJaQWaJTiGD\nXiI2hZQMaGmc4B+rH4IJM2yY8yrlMWYInCfr6o12bMiDRF6+C0gqvXeXZFqQ\nGaAs\r\n=DKeY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDAb1TMVBi3UBdeIsoAIJPD9Hgz1vVMAhPG2w68Q9nqcgIgOZN4Bj+Ex2HfE7KdFQ30JOw23YiwJpOoyCaJdeT0GU4="}],"size":2980,"noattachment":false,"key":"/@iocmd/hold-up/-/@iocmd/hold-up-1.1.2.tgz"},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hold-up_1.1.2_1582645184361_0.01097275884506721"},"_hasShrinkwrap":false,"readme":"# Hold Up [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]\n\n`hold up` is `setInterval` with `promises`, `counter` and `error handling`.\nIt runs a `function` and if it `throws` run it again with interval (defaults to 1 second) `counter` times (defaults to 5). If it fails, promise throws, if successed resolves.\n\n## Install\n\n`npm i @iocmd/hold-up --save`\n\n## API\n\n### holdUp(fn[, options])\n\n### holdUp([fn, args], options)\n\n- `fn` - function\n- `args` - array of arguments\n- `options` - options may contain:\n  - `log`\n  - `count`\n  - `time`\n\n```js\nconst holdUp = require('hold-up');\nconst fn = async (a = 'hello') => {\n    throw Error(a);\n};\n\nawait holdUp(fn);\n\n// reject in a 5 seconds\n// [Error: hello]\n\n// with arguments\nawait holdUp([fn, 'world']);\n\n// reject in a 5 seconds\n//[Error: hello]\n\n// when you need to override options,\nawait holdUp([fn, 'hello'], {\n    count: 5,       // default\n    time: 1000,     // default\n    log: () => {},  // default\n});\n```\n\n## Related\n\n- [currify](https://github.com/coderaiser/currify \"currify\") - translate the evaluation of a function that takes multiple arguments into evaluating a sequence of functions, each with a single or more arguments.\n\n- [fullstore](https://github.com/coderaiser/fullstore \"fullstore\") - functional variables.\n\n- [wraptile](https://github.com/coderaiser/wraptile \"wraptile\") - translate the evaluation of a function that takes multiple arguments into evaluating a sequence of 2 functions, each with a any count of arguments.\n\n## License\n\nMIT\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@iocmd/hold-up.svg?style=flat\n[BuildStatusIMGURL]: https://travis-ci.com/iocmd/hold-up.svg?branch=master\n[LicenseIMGURL]: https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat\n[NPMURL]: https://npmjs.org/package/@iocmd/hold-up \"npm\"\n[BuildStatusURL]: https://travis-ci.com/iocmd/hold-up \"Build Status\"\n[LicenseURL]: https://tldrlegal.com/license/mit-license \"MIT License\"\n[CoverageURL]: https://coveralls.io/github/iocmd/hold-up?branch=master\n[CoverageIMGURL]: https://coveralls.io/repos/iocmd/hold-up/badge.svg?branch=master&service=github\n","publish_time":1582645184470,"_cnpm_publish_time":1582645184470,"dist-tags":{"latest":"2.1.0"}}