# @rpldy/abort

> adds the capability to abort/cancel running & pending uploads

Latest version **1.13.0** (published 2025-11-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install @rpldy/abort
pnpm add @rpldy/abort
yarn add @rpldy/abort
bun add @rpldy/abort
```

## Health

**Score 60/100 (C)** — status: stable.

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.13.0 |
| Published | 2025-11-26 |
| First published | 2022-08-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 11.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1252 |
| Author | yoav niran (https://github.com/yoavniran) |
| Maintainers | yoavniran |

## Links

- npm: https://www.npmjs.com/package/@rpldy/abort
- Repository: https://github.com/rpldy/react-uploady
- Homepage: https://react-uploady.org
- Funding: https://opencollective.com/react-uploady
- npm.io page: https://npm.io/package/@rpldy/abort

## Dependencies (3)

- [@rpldy/shared](https://npm.io/package/@rpldy/shared.md) 1.13.0
- [@rpldy/raw-uploader](https://npm.io/package/@rpldy/raw-uploader.md) 1.13.0
- [@rpldy/simple-state](https://npm.io/package/@rpldy/simple-state.md) 1.13.0

## Recent versions

- 1.13.0 (latest) — 2025-11-26
- 1.12.0-rc.0 (next) — 2025-10-28
- 1.4.2-alpha.0 (alpha) — 2023-03-27
- 1.12.0 — 2025-10-30
- 1.11.0 — 2025-07-18
- 1.10.0 — 2025-04-18
- 1.9.1 — 2025-02-07
- 1.9.0 — 2024-12-13
- 1.9.0-rc.2 — 2024-12-08
- 1.9.0-rc.1 — 2024-11-10
- 1.9.0-rc.0 — 2024-11-04
- 1.8.3 — 2024-08-19
- 1.8.2 — 2024-07-30
- 1.8.1 — 2024-05-16
- 1.8.0 — 2024-02-22
- … 33 more at https://npm.io/package/@rpldy/abort/versions

## README

<a href="https://opencollective.com/react-uploady">
    <img src="https://img.shields.io/opencollective/all/react-uploady?style=flat&logo=opencollective&label=Support%20us!&color=blue" alt="Support on Open Collective"/>
</a>
<a href="https://badge.fury.io/js/%40rpldy%2Fabort">
    <img src="https://badge.fury.io/js/%40rpldy%2Fabort.svg" alt="npm version" height="20"></a>
<a href="https://github.com/rpldy/react-uploady/actions/workflows/pr.yml">
        <img src="https://github.com/rpldy/react-uploady/actions/workflows/pr.yml/badge.svg" alt="Build Status"/></a>  
<a href="https://codecov.io/gh/rpldy/react-uploady">
    <img src="https://codecov.io/gh/rpldy/react-uploady/branch/master/graph/badge.svg" alt="codecov status"/></a> 
<a href="https://bundlephobia.com/result?p=@rpldy/abort">
    <img src="https://badgen.net/bundlephobia/minzip/@rpldy/abort" alt="bundlephobia badge"/></a>
<a href="https://react-uploady-storybook.netlify.app">
   <img src="https://cdn.jsdelivr.net/gh/storybookjs/brand@master/badge/badge-storybook.svg" alt="rpldy storybook"/></a> 

# Abort

Adds the capability to abort/cancel running & pending uploads

This is an internal package the uploader consumes.

Abort exposes an UploaderEnhancer that adds the abort methods to the Uploader Options.

**The best place to get started is at our: [React-Uploady Documentation Website](https://react-uploady.org)**

## Installation

```shell
#Yarn:
  $ yarn add @rpldy/abort

#NPM:
  $ npm i @rpldy/abort
```

## Normal vs. Fast Abort

When the number of pending/active uploads is less than the configured threshold (fastAbortThreshold param) or when the threshold is turned off (equals 0), _normal_ abort flow will be used.

In case the threshold is configured and the item count is equal or larger, the _fast_ abort flow will be used.

For All Abort, the threshold is compared against the total number of pending/active items
For Batch Abort, the threshold is compared against the number of pending/active items in the batch. 

In both cases, finished items are ignored in the comparison.

### Normal

**Normal** flow means that every item whether its already uploading or still pending will be individually aborted and an "ITEM_ABORT" event will be fired. 
For abort all, "BATCH_ABORT" event will also be fired respectively. 


### Fast

**Fast** flow means that only active uploads are cancelled (typically very few as concurrent count is set to 1 by default). 

Pending items are ignored and are simply removed from the queue by the uploader. 
For abort all, "BATCH_ABORT" events will not be fired and no "ITEM_ABORT" event will be fired for pending items.

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