{"name":"@iocmd/hold-up","version":"1.0.2","access":"public","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":"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":{"coveralls":"^3.0.2","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":"400cd2b3468297d566145590f35178f10b3f99b9","bugs":{"url":"https://github.com/iocmd/hold-up/issues"},"_id":"@iocmd/hold-up@1.0.2","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"dist":{"integrity":"sha512-DCk9ZgUWn1dB1k9USudmcFsHm1oFtOIPJaR8prdTRj+BxdFVioQTLiHo22Ywx8p636P+8qTTd1nbjIPcWlZEZw==","shasum":"9fc04b2583142e1ce37fdf31da472fbc7dbf6d29","tarball":"http://registry-npm.ywwl.com/@iocmd/hold-up/download/@iocmd/hold-up-1.0.2.tgz","fileCount":5,"unpackedSize":6175,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9VjDCRA9TVsSAnZWagAAohwP/jDqGu0CCwfmyndd1D4J\nQbOH03rG2VCkW/IhFSuRWzJ/sMH3urv4rFjy/NQoJMG+ory8EFoteNBdaDyk\nQPX63wbaf79JT2jRCbQ2Yk4+fS4SCO2Sbyg05XI5dpFtoHRoyAG6TfDntYTO\nX+7tf0zEvuFUpOUQDb3PtJgONukP1oNqdf/SUmOK3/9FQ+58jCUqFS+vg52L\nNfdzwbcqjQL4l5WwHuII8JhX0WCI/F8IUcggwgTHnj6GhBAixuAtJyWcx8RH\n1TgzWmWYucq5sjHW1F0CzIOLiAYHZFT8D31wKreK/BQy4e1haP2VxTdHhaAU\nb2+M/vwDr8mjxou66jkoo3C3GdvpveACV3rPzRr28bag1KfbsaqSmD8B4uOG\n4QBgBkn9Xr0Itz0rTk3fv61Q8+pDjcxAAjBaepEMYug1e92jHoZaxPAwugeU\nhq/9BOY3VFGhzQX1coKVqE62ZO+BAf3rhssGpix9zVX0qSjqTJt753FFmx+N\nbMiu2Xeqc3JgxsIFLvivGt4SVo6yYnxH7IO88x6dthpW0FTI7rW0+Vxxe9BF\nDOaPOihc+rsqTgC1LJv8PthOVV5KZ3ri2GX5hGCQZmg8lwtVg4Lrt9hRAQhI\nmOVW65F7H1m9olqMqAILj7+2E2O7Jiago4yoxmIAAJyjDnZe+Eix4M0Qq0U3\ndp8Z\r\n=y58g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC3RaEl+KCFkG/BUFF0R7LyzAkOJ0+TobtB6Yqie64+GQIgNhkfHGYZc73SKNSkIsWTmRjSoDxhHXW9FrHV6MjjRnM="}],"size":2757,"noattachment":false,"key":"/@iocmd/hold-up/-/@iocmd/hold-up-1.0.2.tgz"},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hold-up_1.0.2_1542805698324_0.5712927857970265"},"_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":1542805698458,"_cnpm_publish_time":1542805698458,"dist-tags":{"latest":"2.1.0"}}