{"library":"weak-napi","type":"library","category":null,"description":"weak-napi is a Node.js module that provides functionality for creating weak references to JavaScript objects and registering callbacks that execute upon an object's garbage collection. It exposes the underlying V8 engine's GC tracking features, which are otherwise inaccessible from JavaScript. The current stable version is 2.0.2, with a release cadence primarily focused on N-API compatibility and stability. A key differentiator from its predecessor, `node-weak`, is its utilization of N-API, eliminating the need for recompilation across different Node.js versions and improving the robustness of GC callbacks to prevent crashes. It requires Node.js 6 or newer due to its reliance on Proxy objects for comprehensive property handling, and notably does not support the `isNearDeath()` API. This module is commonly employed for debugging memory leaks and understanding the lifecycle of objects within Node.js applications.","language":"javascript","status":"active","version":"2.0.2","tags":["javascript","weak","reference","js","object","function","callback","napi"],"last_verified":"Wed May 27","install":[{"cmd":"npm install weak-napi","imports":["const weak = require('weak-napi')","import weak from 'weak-napi'"]},{"cmd":"yarn add weak-napi","imports":[]},{"cmd":"pnpm add weak-napi","imports":[]}],"homepage":null,"github":"https://github.com/node-ffi-napi/weak-napi","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/weak-napi","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/weak-napi/compatibility"}}