{"name":"@iocmd/hold-up","version":"1.0.3","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":"ca9c33c70349145be831930fdbd67e53d5905917","bugs":{"url":"https://github.com/iocmd/hold-up/issues"},"_id":"@iocmd/hold-up@1.0.3","_npmVersion":"6.4.1","_nodeVersion":"11.2.0","_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"dist":{"integrity":"sha512-VTwPB7sLX1XKvg8CWMXJJ0XUhtNdfMrqfBh94JAi7XYUvafVqkKf8atnC3Xsdc5mJqj35UB+CiOufkLu7sQ5jw==","shasum":"6f939fc14e7cff0c078671b010ee2112e72267e3","tarball":"http://registry-npm.ywwl.com/@iocmd/hold-up/download/@iocmd/hold-up-1.0.3.tgz","fileCount":5,"unpackedSize":6236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb9V7aCRA9TVsSAnZWagAAnqkP/1heP36FFeftQQVleQs2\nDB5pwytQ9NGFXcdQvGYzgabgeWKwJ7sN5QQUr+u9hysxuEEAdrOVEUf2EO5c\nicIMNEluEeUTr4lpf3rbN/Q2OmlHwGxg3y5l346wo0G5+LEazd7u9jTIJvAM\nu8lYwgUF579D5Ci4tt3MCZ+x3eL9RHMuXAPWRnFaUTLRAEGqCdrK1frMGSU+\nVS3ZmPOVus0cyY0vazHXpFHRAfo1UdEVEL2FqdiW19cZ1u1cBcBX6Ddel6p0\nmZlU4XCoOZrF94tz557d9Ocf4z0I4e5rihUUtRHfZSwd/GAdPpPG7CyweFS3\nNJfEzymXlMKaaLi4nJz9GVtcuDWOTDUwAgqUD8ibzAd7m/hDG/C30FXDvnmM\nZWjGfMm0DtpkbBIyaHcJM3rskL7LYjp0cF007vEOolvEHzFO/ALy4sgGYuGd\npgWuq8/RGGLBnt7yCgBRghWwvD9g8fl/I0dw8TA1qiSvb2y/UJJcO9K82NhJ\nrMvBJaYE8zyIJ0NXJy0N5i/pjQWDmW6jW+mWAqs0/JRnHXXM2KMt5IJnZUc/\n8QrvwUUeqCSoXPSn9Yf2lfqQfW1JB6W8caSySbz8KZYajeIJ831R7Ejv1VS+\nxGxmtgbbZy6UU8iZTtHlV3ByyVFJ5PQ0cMcAa7PfJH48r9/EKg6zoA1rj06j\nX2P3\r\n=dv05\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBWe1G+ZasjBdfGd3aUjOAXLJsSjC9wjELn9sxg1WNvQIhAMJsQfXRWTBaPMsU1ETQVsJ/9eTShwHwz61siHq8IJVD"}],"size":2767,"noattachment":false,"key":"/@iocmd/hold-up/-/@iocmd/hold-up-1.0.3.tgz"},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hold-up_1.0.3_1542807257579_0.24304919455033547"},"_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":1542807257679,"_cnpm_publish_time":1542807257679,"dist-tags":{"latest":"2.1.0"}}