{"name":"retry-as-promised","version":"7.1.0","keywords":["retry","promise","bluebird"],"author":{"name":"Mick Hansen","email":"maker@mhansen.io"},"license":"MIT","_id":"retry-as-promised@7.1.0","homepage":"https://github.com/mickhansen/retry-as-promised","bugs":{"url":"https://github.com/mickhansen/retry-as-promised/issues"},"dist":{"shasum":"d8bfb8b23607e81c7242dc8ec5aba1311102adea","tarball":"http://registry-npm.ywwl.com/retry-as-promised/download/retry-as-promised-7.1.0.tgz","fileCount":9,"integrity":"sha512-LXCQasDZ+bwxs0+iqxy2Q2jfpLs/vkdP5kTAICCIxwhno8Abjcmy7aAIVx6aunJgbiqreWGoapX8guMWwRGajA==","signatures":[{"sig":"MEYCIQCQvaZ42p6ELExeBLnsGbN3QJBuBkb9iRZjgPHaxGeMrAIhAKwHqgFHM4nrniQVNJbGytriPdSN3yW8c2vVtFB3BVzv","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40008,"size":9934,"noattachment":false,"key":"/retry-as-promised/-/retry-as-promised-7.1.0.tgz"},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"7e04b0d0d581de2db58f7deb44bfa3ab726ca44f","scripts":{"test":"cross-env DEBUG=retry-as-promised* ./node_modules/.bin/mocha --register ts-node/register --check-leaks --colors -t 10000 --reporter spec test/promise.test.js","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"mickhansen","email":"mick.kasper.hansen@gmail.com"},"repository":{"url":"git+https://github.com/mickhansen/retry-as-promised.git","type":"git"},"_npmVersion":"9.8.1","description":"Retry a failed promise","directories":{},"_nodeVersion":"18.18.2","_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","mocha":"^9.1.3","sinon":"^7.0.0","moment":"^2.10.6","ts-node":"^10.9.1","cross-env":"^5.2.0","sinon-chai":"^3.2.0","typescript":"^4.9.3","chai-as-promised":"^7.1.1"},"_npmOperationalInternal":{"tmp":"tmp/retry-as-promised_7.1.0_1740496796072_0.46664887660357035","host":"s3://npm-registry-packages-npm-production"},"readme":"# retry-as-promised\n\nRetry promises when they fail\n\n## Installation\n\n```sh\n$ npm install --save retry-as-promised\n$ yarn add retry-as-promised\n```\n\n## Configuration\n\n```js\nvar retry = require('retry-as-promised').default;\n\nvar warningFn = function(msg){ someLoggingFunction(msg, 'notice'); };\n\n// Will call the until max retries or the promise is resolved.\nreturn retry(function (options) {\n  // options.current, times callback has been called including this call\n  return promise;\n}, {\n  max: 3, // maximum amount of tries\n  timeout: 10000 // throw if no response or error within millisecond timeout, default: undefined,\n  match: [ // Must match error signature (ala bluebird catch) to continue\n    Sequelize.ConnectionError,\n    'SQLITE_BUSY'\n  ],\n  backoffBase: 1000 // Initial backoff duration in ms. Default: 100,\n  backoffExponent: 1.5 // Exponent to increase backoff each try. Default: 1.1\n  backoffJitter: 150 // Amount of randomized jitter in ms to add to retry interval to spread retries out over time. Default: 0.0.\n  report: warningFn, // the function used for reporting; must have a (string, object) argument signature, where string is the message that will passed in by retry-as-promised, and the object will be this configuration object + the $current property\n  name:  'SourceX' // if user supplies string, it will be used when composing error/reporting messages; else if retry gets a callback, uses callback name in erroring/reporting; else (default) uses literal string 'unknown'\n});\n```\n\n## Tested with\n\n- Bluebird\n- Q\n","publish_time":1740496796227,"maintainers":[{"name":"mickhansen","email":"mick.kasper.hansen@gmail.com"}],"_cnpm_publish_time":1740496796227,"dist-tags":{"latest":"7.1.1"}}