{"name":"retry-as-promised","version":"7.1.1","description":"Retry a failed promise","main":"dist/index.js","types":"dist/index.d.ts","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","check":"tsc --noEmit","prepublishOnly":"npm run build"},"repository":{"type":"git","url":"git+https://github.com/mickhansen/retry-as-promised.git"},"keywords":["retry","promise","bluebird"],"author":{"name":"Mick Hansen","email":"maker@mhansen.io"},"license":"MIT","bugs":{"url":"https://github.com/mickhansen/retry-as-promised/issues"},"homepage":"https://github.com/mickhansen/retry-as-promised","devDependencies":{"chai":"^4.2.0","chai-as-promised":"^7.1.1","cross-env":"^5.2.0","mocha":"^9.1.3","moment":"^2.10.6","sinon":"^7.0.0","sinon-chai":"^3.2.0","ts-node":"^10.9.1","typescript":"^4.9.3"},"_id":"retry-as-promised@7.1.1","gitHead":"ca56f0c390786395ecdf55db9d78be2bb7fdb1a6","_nodeVersion":"18.18.2","_npmVersion":"9.8.1","dist":{"integrity":"sha512-hMD7odLOt3LkTjcif8aRZqi/hybjpLNgSk5oF5FCowfCjok6LukpN2bDX7R5wDmbgBQFn7YoBxSagmtXHaJYJw==","shasum":"3626246f04c1941ff10cebcfa3df0577fd8ab2d7","tarball":"http://registry-npm.ywwl.com/retry-as-promised/download/retry-as-promised-7.1.1.tgz","fileCount":9,"unpackedSize":40147,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIB59t+TsMnUMizLBa/YqAirvUANZ0xpLt61YMArTtveYAiBDXm3l4UqXt66b4N9vD8wbhuu0kdr3aFsC6j1rbltB0w=="}],"size":9974,"noattachment":false,"key":"/retry-as-promised/-/retry-as-promised-7.1.1.tgz"},"_npmUser":{"name":"mickhansen","email":"mick.kasper.hansen@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/retry-as-promised_7.1.1_1740645556247_0.6490665745518516"},"_hasShrinkwrap":false,"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":1740645556431,"maintainers":[{"name":"mickhansen","email":"mick.kasper.hansen@gmail.com"}],"_cnpm_publish_time":1740645556431,"dist-tags":{"latest":"7.1.1"}}