{"name":"@iocmd/hold-up","version":"1.1.0","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":"^1.1.1"},"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":"7710a8d158ba3de3274356d4f2373c4f0bd089a8","bugs":{"url":"https://github.com/iocmd/hold-up/issues"},"_id":"@iocmd/hold-up@1.1.0","_nodeVersion":"12.8.0","_npmVersion":"6.10.0","dist":{"integrity":"sha512-vpdMcxB8K350d6X/qsm0UB6R8+CKHfjdAG/pcL8SbnfyB38FwVolrsEzEuIk3OvEO77bvk+lCtK7LO2R0w60VQ==","shasum":"d22d5ebe0671f66e59fcfdbe803a1a0ba3dd9d81","tarball":"http://registry-npm.ywwl.com/@iocmd/hold-up/download/@iocmd/hold-up-1.1.0.tgz","fileCount":5,"unpackedSize":6482,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdVl9BCRA9TVsSAnZWagAAX1EP/RwoOfg/Yj6iDxcO/xD6\nBiUA5ctoUtb9IDv79MnXPdp6fN4GiKqmteF8C39vnrwIOuV1rmvOZaux5t5Z\nnAjOS9ZFcOaeoszWYa0lUkmSW3hNcCRUS7lml0/veK27qW4CTCIkkg1qSpIf\nnFFG59SgsUKPCA3NN2tKbTbnwnRdnpOuSpatZeOibhZtInKe93E1QbQunY7d\nf/tfhFIvcrt8WvJ/0wShDkX6Pr9AhzC432A9WJI4r5y+0EwAXWHE30F72sAn\n7dY2YbonkbdnFnEoAeGRjDcyjOOW1MVyBEsyOFLm1HsV8dnar0BmZZJbLhwr\nkC36ArM5MvT4RiWbrcwJ+elLDVPMoiT8KDHEp/K/grZQ2nQVOHaZSq/HYz+U\nCH466rIPgaoboTP5/n/+yN078O/MI1nub8bNfxO8qfxMcVF+W2vDGIfx2yo0\n1eRJ9voAuYUMFX1ITpxHogaT8NpZHo8ZxaxUJbYT05P9j9xOPWx/ElAP39RB\nXzqYHuFJaNfVqzpb60AN15AjMmWjitN3KEPDsg8F0q/RY2c6qT0RjIohjzHi\nv3RRD5FayiiDbUtyKqGGhcrN2rCTEZ6XxJ1EnmI7VlKtPKvMHgLcxxvuOeiA\nz7zWkfm2AnjY4Hn+hxJNXNCu16KyOiv4A17tqKw330E4SlKlpwpLPQSzWi+J\ncua2\r\n=DBQS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGGb6e5xrW2yskGwHabihKM+LggWzseL1vXAioEwUBiVAiEAyPdgWq7Hed+PF4kHhtDfXDPjsBp7JAfsR85LQjElok0="}],"size":2821,"noattachment":false,"key":"/@iocmd/hold-up/-/@iocmd/hold-up-1.1.0.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.0_1565941568662_0.4190818163476786"},"_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":1565941568817,"_cnpm_publish_time":1565941568817,"dist-tags":{"latest":"2.1.0"}}