Skip to content
JS
Package

when-exit

Execute a function right before the process, or the browser's tab, is about to exit.

v2.1.5, 28 Oct 2025MITESM onlyTypes: Bundled
$ npm install when-exit

Key numbers

As of 25 Sept 2026
Weekly downloads
7.6m
+301% over 12 months
Gzip bundle size
-
No Bundlephobia data
Dependencies
0
Direct, from package.json
Last release
10 months ago
v2.1.5
GitHub stars
-
Open issues / PRs
- / -
Contributors
-
Commits, last 52 weeks
-

Downloads

Last week 2026-09-15 to 2026-09-21
05m10m15mSept 2025Mar 2026Sept 2026High 10m (25 Aug 2026)Low 1.6m (23 Dec 2025)
Weekly npm downloads, one point per week, weeks starting 23 Sept 2025 to 15 Sept 2026. The y axis starts at zero.

7,622,768 downloads last week, 33,848,689 in the last month. The 12-month change of +301% compares the average of the last 4 weeks with the first 4 weeks of the series.

Releases, last 12 months
18 in total
Latest version
2.1.5, 28 Oct 202510 months ago
First published
8 Feb 2022
Last push to GitHub
-
Repository archived
-
Open issues
-
Open pull requests
-
Commits, last 52 weeks
-
Dependents on npm
31

Major versions

  1. v2 first release 2.0.0, 6 Apr 2022
  2. v1 first release 1.0.0, 8 Feb 2022

Recent releases

VersionPublished
2.1.528 Oct 2025
2.1.412 Jan 2025
2.1.330 Jun 2024
2.1.29 Dec 2023
2.1.13 Aug 2023
2.1.015 Feb 2023
2.0.06 Apr 2022
1.0.08 Feb 2022
Module format
ESM onlyFrom package.json type, main and exports fields
TypeScript types
Bundled
Node.js engine range
Not declared
Runtimes
-
Unpacked size (npm)
6.7 kB
Dependencies (0)
None
npm install when-exit
  • jsDelivrhttps://cdn.jsdelivr.net/npm/when-exit@2.1.5/
  • unpkghttps://unpkg.com/when-exit@2.1.5/
  • esm.shhttps://esm.sh/when-exit@2.1.5
Sources: npm registry, npm downloads API. Data fetched 25 Sept 2026.

Indexability: Not indexed (discovery only): GitHub data not fetched yet; no category.