{"name":"@iocmd/hold-up","version":"1.1.1","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":"^2.0.0"},"license":"MIT","devDependencies":{"@cloudcmd/stub":"^2.3.1","coveralls":"^3.0.2","eslint":"^6.1.0","eslint-plugin-node":"^9.1.0","madrun":"^2.5.0","nodemon":"^1.11.0","nyc":"^14.1.1","putout":"^5.5.0","redrun":"^7.0.0","supertape":"^1.2.3"},"engines":{"node":">=8"},"publishConfig":{"access":"public"},"gitHead":"f47f7444853d0c21de8d08cbbaa42b6cd885f0a4","bugs":{"url":"https://github.com/iocmd/hold-up/issues"},"_id":"@iocmd/hold-up@1.1.1","_nodeVersion":"12.12.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-xGxN5EvtgCxsC8GVN/dVzvlIioy/gkM6pEM7wYVHBMYQL0y3qYqLpryncLdYnRAx9tK35Stv9FwJ+S84axr2Ag==","shasum":"afc8f4095e75cd1f5449d7b90cffa0e56a3c4f7e","tarball":"http://registry-npm.ywwl.com/@iocmd/hold-up/download/@iocmd/hold-up-1.1.1.tgz","fileCount":5,"unpackedSize":6546,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdp2+cCRA9TVsSAnZWagAA4S8P/jcPKy4LRpRvEIIPNgsF\nUntyNv8UoicbJiyqCXsnczCmop4Fv9FQD9fL3uc4uW1p16pglWXxFdsp1E58\ndCyv4H/AAfrTSAuO8fj8mvD0UF5TPbZvM9dAMsXzlmVKYCOBcug7FuVggLOu\nGED3a7HDGnYLo4bfNdbW60Pxv+feiP2K+Lzcpy20Ao+Un7onko6X8XAGA3bD\nHJBSeZbGizS2su6EX6RArHH2VSPIpVYS2jBC3AtfChOi9a10+FpjYy45T01C\nZryIy+UAeBjf/22xUx/Zl3NIUcDYXxuxK8SjknyprTWhsjNje2o8mXZMOE1N\nE7cotHpOcKSkyXreR2rf9a2kI4ab6sSr1iVDynlRtx93evxxdmKfCIeJ/sz3\nQ4wt/ElAd9Xc4laAq3Do3aEUtvuhEhnED7Uxrmplp+1TVkBtMegEddTo/4IS\nvRjhhZPWNzwhKRTxC2mhogGjYsk0+S3mSqV02fxjtD/LOdQeOmW5+mpbTfJV\nzJPb2YSelZ53Rh9VWLm7yAMDw6KIinvr4e4T9W8gKNuTGQPdufd+Gy30vGmK\nnmOujpkWL3GHP/YrpFL+ZfZxvA6YjhArCyY6L2GgCy15acpBKUTPD6QZU+QC\nnWlK26ZdHp2BlRu6o4aB8g0wNxKnl7CfwIr5oNS+YKrh2SGga6F/Slsp2GmN\nCAlW\r\n=Ffmu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAKAgFRebNj+ksI/w5JFHkP3pp+3O+hjs99iI5afKJovAiB0u8G3PvCuIwPd9mGlmOcyEJUDvkrGl/Ch7n3doTQKzw=="}],"size":2837,"noattachment":false,"key":"/@iocmd/hold-up/-/@iocmd/hold-up-1.1.1.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.1_1571254171473_0.25002092838073753"},"_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":1571254171613,"_cnpm_publish_time":1571254171613,"dist-tags":{"latest":"2.1.0"}}