# @sunrisecn/axios-abort

> axios cancel duplicate request

Latest version **1.2.4** (published 2023-06-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install @sunrisecn/axios-abort
pnpm add @sunrisecn/axios-abort
yarn add @sunrisecn/axios-abort
bun add @sunrisecn/axios-abort
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.4 |
| Published | 2023-06-09 |
| First published | 2023-02-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >14 |
| Dependencies | 0 |
| Unpacked size | 6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | yinuo |
| Maintainers | f5l5y5 |
| Keywords | axios, cancel duplicate |

## Links

- npm: https://www.npmjs.com/package/@sunrisecn/axios-abort
- Repository: https://github.com/f5l5y5/axios-abort
- Homepage: https://github.com/f5l5y5/axios-abort/blob/main/README.md
- npm.io page: https://npm.io/package/@sunrisecn/axios-abort

## Recent versions

- 1.2.4 (latest) — 2023-06-09
- 1.2.3 — 2023-06-09
- 1.2.2 — 2023-06-09
- 1.2.1 — 2023-06-09
- 1.2.0 — 2023-06-09
- 1.1.1 — 2023-02-19
- 1.1.0 — 2023-02-19
- 1.0.7 — 2023-02-19
- 1.0.6 — 2023-02-19
- 1.0.4 — 2023-02-10
- 1.0.3 — 2023-02-10
- 1.0.2 — 2023-02-09
- 1.0.1 — 2023-02-08
- 1.0.0 — 2023-02-08

## README

# axios-abort

The axios-abort library is for axios cancel request.

##  Installation:

### Using npm/yarn/pnpm:

```js
npm install @sunrisecn/axios-abort --save

yarn/pnpm add @sunrisecn/axios-abort
```

### Usage:

Starting from v0.22.0 Axios supports AbortController to cancel requests.

```js
import axios from 'axios'
import abort from 'axios-abort'

const axios = axios.create(config)

axios.interceptors.request.use(
	config => {
		abort.judge(config)
		return config
	},
	error => Promise.reject(error)
)

axios.interceptors.response.use(
	response => {
		abort.remove(config)
		return response
	},
	error => Promise.reject(error)
)

```

### API

```js
- judge
	- judge whether the cancellation conditions are met
- remove
	- remove url after success or failure
- removeAll
	- removeAll url 
```

---
_Source: https://npm.io/package/@sunrisecn/axios-abort · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
