git404hub

what is cancellation fr?

gaearon/cancellation — explained in plain English

Analysis updated 2026-07-17 · repo last pushed 2015-01-19

1JavaScriptAudience · developerComplexity · 2/5DormantSetup · easy

tl;dr

A JavaScript library that lets you cleanly stop a running async operation, like an HTTP request or long loop, using a cancellation token.

vibe map

mindmap
  root((repo))
    What it does
      Cancels async operations
      Provides cancellation tokens
      Cleans up gracefully
    Tech stack
      JavaScript
    Use cases
      Abort HTTP requests
      Interrupt long computations
      Stop background loops
    Audience
      Web app developers
      Node.js server developers
      JavaScript engineers
    How it works
      Create token source
      Pass token to async function
      Call cancel to trigger cleanup

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Abort an in-progress file download or HTTP request when a user navigates away

VIBE 2

Interrupt a long-running computation or loop cleanly instead of letting it run silently

VIBE 3

Manage and shut down multiple background async tasks in a web app or Node.js server

what's the stack?

JavaScript

how it stacks up fr

gaearon/cancellation0xmukesh/docusaurus-tutoriala15n/andrewscheuermann
Stars111
LanguageJavaScriptJavaScriptJavaScript
Last pushed2015-01-192021-12-272015-01-11
MaintenanceDormantDormantDormant
Setup difficultyeasyeasymoderate
Complexity2/52/51/5
Audiencedeveloperdevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · easy time til it works · 5min

prompts (copy fr)

prompt 1
Show me how to create a cancellation token source with this library and pass it to an async function.
prompt 2
Help me add cancellation support to my HTTP request function using this library.
prompt 3
Explain how to check for cancellation inside a loop and clean up when it's triggered.
prompt 4
Help me stop a long-running background task gracefully when a user cancels an action.

Frequently asked questions

what is cancellation fr?

A JavaScript library that lets you cleanly stop a running async operation, like an HTTP request or long loop, using a cancellation token.

What language is cancellation written in?

Mainly JavaScript. The stack also includes JavaScript.

Is cancellation actively maintained?

Dormant — no commits in 2+ years (last push 2015-01-19).

How hard is cancellation to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is cancellation for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.