Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

async-await-retry

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

async-await-retry - npm Package Compare versions

Comparing version 1.1.0 to 1.1.2

26

package.json
{
"name": "async-await-retry",
"version": "1.1.0",
"version": "1.1.2",
"description": "Simple module to retry a function with async/await syntax !",
"main": "index.js",
"bin": "./index.js",
"types": "./index.d.ts",
"exports": {
"require": "./index.js",
"import": "./index.js"
},
"files": [
"src/**"
],
"engines": {

@@ -16,9 +26,13 @@ "node": ">=7.6.0"

"promises",
"retries"
"retries",
"error"
],
"homepage": "https://github.com/VoodooTeam/async-await-retry",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/VoodooTeam/async-await-retry.git"
},
"scripts": {
"test": "./node_modules/.bin/jest",
"lint": "./node_modules/.bin/eslint -c ./.eslintrc ./",
"linter": "./node_modules/.bin/eslint -c ./.eslintrc ./",
"all": "npm run lint && npm run test"

@@ -34,5 +48,5 @@ },

"devDependencies": {
"eslint": "^7.5.0",
"jest": "^26.1.0"
"eslint": "^7.15.0",
"jest": "^26.3.0"
}
}
<div align="center">
<b>Async / Await exponential retry</b><br/>
<br/><br/>
<a href="https://badge.fury.io/js/async-await-retry">
<img src="https://badge.fury.io/js/async-await-retry.svg" alt="npm version" height="18">
</a>
</div>
[![GitHub release](https://badge.fury.io/js/async-await-retry.svg)](https://github.com/VoodooTeam/async-await-retry/releases/)
[![GitHub license](https://img.shields.io/github/license/VoodooTeam/async-await-retry)](https://github.com/VoodooTeam/async-await-retry/blob/master/LICENSE)
[![CI pipeline](https://github.com/VoodooTeam/async-await-retry/workflows/Node.js%20CI/badge.svg)](https://github.com/VoodooTeam/async-await-retry/actions?query=workflow%3A%22Node.js+CI%22)
[![Opened issues](https://img.shields.io/github/issues-raw/VoodooTeam/async-await-retry)](https://github.com/VoodooTeam/async-await-retry/issues)
[![Opened PR](https://img.shields.io/github/issues-pr-raw/VoodooTeam/async-await-retry)](https://github.com/VoodooTeam/async-await-retry/pulls)
# Purpose

@@ -12,0 +14,0 @@

@@ -53,3 +53,3 @@ const getPromise = (fn, args) => {

let interval = config.interval || 0;
const exponential = config.hasOwnProperty('exponential') ? config.exponential : true;
const exponential = Object.prototype.hasOwnProperty.call(config, 'exponential') ? config.exponential : true;
const factor = config.factor || 2;

@@ -68,3 +68,3 @@ const onAttemptFail = typeof config.onAttemptFail === 'function' ? config.onAttemptFail : onAttemptFailFallback;

} catch (error) {
if(retriesMax === i+1 || (error.hasOwnProperty('retryable') && !error.retryable)) throw error;
if(retriesMax === i+1 || (Object.prototype.hasOwnProperty.call(error, 'retryable') && !error.retryable)) throw error;
const result = await onAttemptFail({

@@ -71,0 +71,0 @@ error,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc