gc-hook: Simplified FinalizationRegistry

JSON →
library 0.4.1 ·javascript maintenance
verified May 27, 2026

gc-hook is a utility library that simplifies the use of JavaScript's `FinalizationRegistry` for managing object lifecycle and reacting to garbage collection. The current stable version is 0.4.1, with the last publish being a year ago, suggesting a mature but not rapidly evolving codebase. It differentiates itself by addressing common pitfalls associated with `FinalizationRegistry`, such as preventing accidental leaks of the registered reference, allowing flexible proxy overrides, and providing mechanisms for explicit deregistration via held references or tokens. Its primary goal is to abstract away the complex specifics of `FinalizationRegistry`, enabling developers to focus on application logic rather than the intricacies of memory management. It works in both CommonJS and ES module environments, offering broad compatibility.

total hits 21
actors 9 distinct systems
last hit 1d ago Amazonbot
Amazonbot
4
MetaBot
4
GPTBot
2
Script
1
ByteDance
1
Search engines
1
Humans
1

top countries 🇺🇸 United States · 🇩🇪 Germany · 🇫🇷 France · 🇨🇦 Canada · 🇸🇬 Singapore