Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ umd/
coverage/
.nyc_output/
.vscode/
.rts2*
dist/
package-lock.json
10 changes: 10 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@axa-ch/retry-axios

This product is a derivative work of the original software "retry-axios" developed by Justin Beckwith available at:
https://github.com/JustinBeckwith/retry-axios
License Apacha-2.0

This redistribution contains following contributions:

Bundling and packaging for ES-Modules, CommonJS and UMD provided by Andreas Deuschlinger at:
https://github.com/JustinBeckwith/retry-axios/pull/107
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# retry-axios
# @axa-ch/retry-axios

**Note:** This is a redistribution of [`retry-axios`](https://github.com/JustinBeckwith/retry-axios) with following modifications:

- Bundling and packaging for ES-Modules, CommonJS and UMD provided at:
https://github.com/JustinBeckwith/retry-axios/pull/107

> Use Axios interceptors to automatically retry failed requests. Super flexible. Built in exponential backoff.

Expand All @@ -12,7 +17,7 @@
## Installation

```sh
npm install retry-axios
npm install @axa-ch/retry-axios
```

## Usage
Expand All @@ -21,14 +26,14 @@ To use this library, import it alongside of `axios`:

```js
// Just import rax and your favorite version of axios
const rax = require('retry-axios');
const rax = require('@axa-ch/retry-axios');
const axios = require('axios');
```

Or, if you're using TypeScript / es modules:

```js
import * as rax from 'retry-axios';
import * as rax from '@axa-ch/retry-axios';
import axios from 'axios';
```

Expand Down
28 changes: 20 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"name": "retry-axios",
"version": "0.0.0",
"name": "@axa-ch/retry-axios",
"version": "2.1.2",
"description": "Retry HTTP requests with Axios.",
"main": "./build/src/index.js",
"types": "./build/src/index.d.ts",
"source": "src/index.ts",
"main": "dist/index.js",
"module": "dist/index.module.js",
"unpkg": "dist/index.umd.js",
"types": "dist/index.d.ts",
"engines": {
"node": ">=10.0.0"
},
Expand All @@ -16,10 +19,11 @@
"clean": "gts clean",
"codecov": "c8 report --reporter=json && codecov -f coverage/*.json",
"fix": "gts fix",
"compile": "tsc -p .",
"compile": "tsc -p tsconfig.compile.json",
"build": "microbundle --tsconfig=tsconfig.json",
"umd": "rm -rf umd && babel build/src -d umd --source-maps",
"test": "c8 mocha build/test",
"prepare": "npm run compile",
"prepare": "npm run build",
"pretest": "npm run compile",
"license-check": "jsgl --local ."
},
Expand All @@ -28,8 +32,15 @@
"retry"
],
"author": {
"name": "Justin Beckwith"
"name": "Justin Beckwith",
"url": "https://github.com/JustinBeckwith"
},
"contributors": [
{
"name": "Andreas Deuschlinger",
"url": "https://github.com/axa-ch"
}
],
"license": "Apache-2.0",
"peerDependencies": {
"axios": "*"
Expand All @@ -47,13 +58,14 @@
"codecov": "^3.5.0",
"gts": "^2.0.0",
"js-green-licenses": "^1.0.0",
"microbundle": "^0.11.0",
"mocha": "^7.0.0",
"nock": "^12.0.0",
"semantic-release": "^17.0.4",
"typescript": "~3.8.0"
},
"files": [
"build/src"
"dist"
],
"c8": {
"exclude": [
Expand Down
11 changes: 11 additions & 0 deletions tsconfig.compile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "./node_modules/gts/tsconfig-google.json",
"compilerOptions": {
"rootDir": ".",
"outDir": "build"
},
"include": [
"src/*.ts",
"test/*.ts"
]
}
7 changes: 3 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"extends": "./node_modules/gts/tsconfig-google.json",
"compilerOptions": {
"rootDir": ".",
"outDir": "build"
"outDir": "dist",
"module": "ES2015"
},
"include": [
"src/*.ts",
"test/*.ts"
"src/*.ts"
]
}