{"name":"@iocmd/hold-up","version":"1.0.1","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":{"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":"a47004cf14f3ee00ecabd202c99b8dcaec7f2b75","bugs":{"url":"https://github.com/iocmd/hold-up/issues"},"_id":"@iocmd/hold-up@1.0.1","_npmVersion":"6.4.1","_nodeVersion":"11.1.0","_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"dist":{"integrity":"sha512-tItZlXd+EUs8CjwLooW6lxgQcR6W7Quvfbpj7otaMFdUZEuIGHi+fPCFz5pKOnLO+6rEntgWhVewRCr4uSKwiw==","shasum":"54f8f975ab8e2d5c4c60d7aefc5bf5f53c0d17b1","tarball":"http://registry-npm.ywwl.com/@iocmd/hold-up/download/@iocmd/hold-up-1.0.1.tgz","fileCount":5,"unpackedSize":6191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb8yA9CRA9TVsSAnZWagAA/QAP/0ikr5KzuiOw5D+yCkuo\nNooiccnlKjTciHFVqDIXRSdcbdUHE4jftcVR2J7a0+Ki2U1wfvJ+CNRsATym\nES++YILFOrYfigY03cpprcTKVZwTGmpiyncBwTX8/ujWJhxbIgjhbWJYETIK\n7eH63XdsZUwiLWkTd5Rvuw0W+pM+JtVFFJhi3RgXrDVtgLgCfT++atT0n7VY\nUbRBcly4RYpTXDJCv40jwye1ke54EB4ixc/xMK+XvkrGKczwB+aETjHaFspe\nHez53gDje0kAq+vbTXXuyQu2DcqOBjm6yHFwJQgGZKaSgp1g/G96wtZ78cC0\nxHxfTCkUeeaxUs2ZLJljsmWJ5zgV02DGW7t3HA5MzLZwz86n+bif/XQCciWI\n3p6EBSnzm9yCC40HJ/CwmQkESOdpWqS9VbBxWzC8XPO8SNX0nfyTjFn1mhuy\nFoeg8bi3eCZ3pfuuN4JUdX2HKSkD0N5Pqi+aKoE2+zoN5oxU4j+kEYDPJJOL\ntZjMRinwswQav8B4lqIHdDIZYGE9QxRP46abYFQ+J+Fklu9HxEnI4Rqhm7rM\naOzJjQRDQ4dJnGCvxKuTQqBQB8/rQ53R8IycCp30kmmRfG99y6fnN/vJ4t9R\nQbOx9qeREoKP9H6nuu45Ebj7aBt9IS8nus3OfJHB0FPzq5VaeOA/sb1kjrJ9\n+gDA\r\n=j/w0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDehoxXqQVJ7jLU5It6kh2NoOOq8L0Pl6FKgDIXRe4qpAIgFOoOEg5BTlxGwxscgf3xnBusZxqCtngjPJAK5xJjzWY="}],"size":2749,"noattachment":false,"key":"/@iocmd/hold-up/-/@iocmd/hold-up-1.0.1.tgz"},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hold-up_1.0.1_1542660156899_0.5054674317829342"},"_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":1542660157055,"_cnpm_publish_time":1542660157055,"dist-tags":{"latest":"2.1.0"}}