{"name":"@iocmd/hold-up","version":"2.1.0","type":"commonjs","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":{"@iocmd/wait":"^2.0.0","try-to-catch":"^3.0.0"},"license":"MIT","devDependencies":{"eslint":"^8.12.0","eslint-plugin-node":"^11.0.0","eslint-plugin-putout":"^14.7.1","madrun":"^9.0.2","nodemon":"^2.0.2","nyc":"^15.0.0","putout":"^25.14.0","supertape":"^7.2.1"},"engines":{"node":">=16"},"publishConfig":{"access":"public"},"gitHead":"18fa10170464134b45e5ca6c2d4837bc040af407","bugs":{"url":"https://github.com/iocmd/hold-up/issues"},"_id":"@iocmd/hold-up@2.1.0","_nodeVersion":"16.14.2","_npmVersion":"8.3.0","dist":{"integrity":"sha512-MXdH+K8F8z9cUK7EGogNyQbGl3YCc7pHv+nLh6RlVtMz0vf3UroxzeXR6AZY33PSgXgrwNXajK84i2h2w4whdg==","shasum":"46094d03f5a3fc828c508f6f8e3066268f2839ac","tarball":"http://registry-npm.ywwl.com/@iocmd/hold-up/download/@iocmd/hold-up-2.1.0.tgz","fileCount":5,"unpackedSize":6927,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIQCD0c0W2GPdhBsexP1IGpfwPKCySQJ+vJishcnCpIW2sQIfPc6eW6sgyMWWM9i5Xa6LGIiv7/6NA7tsX+s2maxlPQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiTes/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrYTRAAjrES4ZpR0bKnWeNsDNZbt4okJMENgJ++yuj9BDht+Wl2cy20\r\nIkJif6IL6QezpgNM/XxeHkhuRdTAjtr/WXZay0w+JZpOIcizBNgVtTuThYkC\r\ncDwu+wtJ+knTcBhAkIel/Ar0daj45U20Mh4v/tfL/g5l5v0+j+iQccMaovcw\r\ngx47PuL2UJaktCFvHKYvzySrHjRE8McvVgljcBxtc+SDxFp5bRiOhvcxZI6V\r\nwNEDiyBFt+7QNhl0s26Z+raC/4Xd1FFWEkhNA1wuVFuHcX+YjMf0645FzhRY\r\nMfXxBzeLanESq6RAjU1FeF3txQLRW28f29zKdYE/8QbBA+2TXiFRSwgkCwkt\r\nDlWKmX/4Tw84mS1RVAa5qvIZCJT90fumuhykmum5zNGAYg1QReBWyK/c6BYA\r\nsP5tOfZIE4gaR4z989VyNqh2J1dB75UKCVRzjDZ2x8FHMqR3DC+6IX0omqJS\r\nft3xN1BQZiCNJlC8PcJHkaU+brReD+p1/yHmyiC2ZDELiiMFKWVk+vJ/slGW\r\nTBUbD8uXoWZPpDO0wt/dhnqZhA6SwJo72H3pq/9m6Xas7JsJXKNKweryBv57\r\nKae3wcEaYeZzGCDjSZgIJp20QxX/hSGTd80nNb55OPSxFK4pSKi8kpe3OguD\r\nN5PuGiCuL6gVgwh8Fqk9ce3gRHbmQW9HR6Q=\r\n=sv6r\r\n-----END PGP SIGNATURE-----\r\n","size":2968,"noattachment":false,"key":"/@iocmd/hold-up/-/@iocmd/hold-up-2.1.0.tgz"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hold-up_2.1.0_1649273663550_0.7171641267350002"},"_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":1649273663655,"_cnpm_publish_time":1649273663655,"dist-tags":{"latest":"2.1.0"}}