{"name":"@iocmd/hold-up","version":"1.0.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"],"scripts":{"test":"tape test/*.js","coverage":"nyc npm test","lint":"eslint lib test","report":"nyc report --reporter=text-lcov | coveralls","watcher":"nodemon -w test -w lib --exec","watch:test":"npm run watcher -- npm test","watch:lint":"npm run watcher -- 'npm run lint'","watch:tape":"nodemon -w test -w lib --exec tape","watch:coverage:base":"npm run watcher -- nyc npm test","watch:coverage:tape":"npm run watcher -- nyc tape","watch:coverage":"bin/redrun.js watch:coverage:base"},"dependencies":{"try-to-catch":"^1.1.1"},"license":"MIT","devDependencies":{"eslint":"^5.6.0","eslint-plugin-node":"^8.0.0","nodemon":"^1.11.0","nyc":"^13.0.1","redrun":"^7.0.0","sinon":"^7.1.1","sinon-called-with-diff":"^3.0.0","tape":"^4.5.1"},"engines":{"node":">=8"},"gitHead":"6e7357df839bb5b0c2145cdfb8ff733b8d76dec6","bugs":{"url":"https://github.com/iocmd/hold-up/issues"},"_id":"@iocmd/hold-up@1.0.0","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"dist":{"integrity":"sha512-DCQq4hiS5MltUkCqi0AAp+knsllUG8dR8YSGIzFQNvTX69Z2+n86G+PvhlF9JDOHXTM7mXhtzl4vqKCfXLqowg==","shasum":"30f47e9ea4a142a4db5e4226f4ab3c46aee5dfa5","tarball":"http://registry-npm.ywwl.com/@iocmd/hold-up/download/@iocmd/hold-up-1.0.0.tgz","fileCount":4,"unpackedSize":6087,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8sfcCRA9TVsSAnZWagAAUq8P/2FhZ+269Pr6XDTPShgK\ndfMetexOFU5NEW134EAiMjV7nyPj8BxOO8+k5X4xAW12+ndKbDDesFfro7gd\nq7mhZBxfBmGBBZrg++1oCMUxYZ/wX0Fgw1HPEvkauJ9M98yiKGEj+Cro11vv\nmeJ14+zfQrj/+YPKqEixbV/Xwa5jeUHaz8/FB2I+qkKBh17vFRFkSiCFPaNX\nrzmqO9s0ZBvHfivNF/bfNKCvsX7vGdk0fxFqQOnIbbGN27Oxm3n4sPXITM4O\nrXzVYcB9pZ+3/JIZ8sy6yGr83Wc1qr7fVAsLHK390QjMg+2PHWKaH0xwtPTe\nSO0iRPUhjcqH+fm0e0au1+VDvcGvH65l4hwgE80JWX1R65sGiGsQmQunvXvV\n5J1SMoTkzmacL7566Qu6wF3Sdl1srKrdY5dGaKV1V3t+7pRwXSQKC2WU9/N/\nM9461rkCRmbBnQUZl/GJBDbkUZqgoIaFCU1P90dWtj5L9PiVIkl4EZfCP7K0\ntOA1PQZRini0DbdSfoNjJTpNVnCZtakYS6l4zr4074zOW67NBFLBlNm/QV6g\nsNyHVf+NMzo659EHPBjUa4Q58EKDMZY0CM1a/TPv7pOpL1DFC8mDZQJ1hp7F\nHzleCNCPJU1i+SzGFdTxsdri61JooUUSc/tOr58XJmMAozn9zH5ogYNLhPQQ\nCHgZ\r\n=kxo8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCOxIJmRvhK+yUdWGIlrzzBL14BCCMD1m6NOAqHfwR7BQIhANCwQjWJauESTwD7VZVGTJfMi1vX1fYcIPZ3leytPbTF"}],"size":2662,"noattachment":false,"key":"/@iocmd/hold-up/-/@iocmd/hold-up-1.0.0.tgz"},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hold-up_1.0.0_1542637531943_0.9228529643351449"},"_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":1542637532084,"_cnpm_publish_time":1542637532084,"dist-tags":{"latest":"2.1.0"}}