{"id":21105255,"url":"https://github.com/shyiko/node-finalize-addon","last_synced_at":"2025-12-28T19:15:24.708Z","repository":{"id":57236125,"uuid":"131528397","full_name":"shyiko/node-finalize-addon","owner":"shyiko","description":"Object finalization based on N-API for Node.js v8.6.0+","archived":false,"fork":false,"pushed_at":"2018-04-30T06:00:05.000Z","size":16,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-20T20:46:53.544Z","etag":null,"topics":["finalize","n-api","node-addon","weak"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shyiko.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-29T20:40:49.000Z","updated_at":"2021-06-18T01:05:20.000Z","dependencies_parsed_at":"2022-08-23T16:20:16.151Z","dependency_job_id":null,"html_url":"https://github.com/shyiko/node-finalize-addon","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shyiko%2Fnode-finalize-addon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shyiko%2Fnode-finalize-addon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shyiko%2Fnode-finalize-addon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shyiko%2Fnode-finalize-addon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shyiko","download_url":"https://codeload.github.com/shyiko/node-finalize-addon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243551230,"owners_count":20309291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["finalize","n-api","node-addon","weak"],"created_at":"2024-11-20T00:04:47.706Z","updated_at":"2025-12-28T19:15:24.657Z","avatar_url":"https://github.com/shyiko.png","language":"C++","readme":"# node-finalize-addon [![Build Status](https://travis-ci.org/shyiko/node-finalize-addon.svg?branch=master)](https://travis-ci.org/shyiko/node-finalize-addon) [![npm](https://img.shields.io/npm/v/finalize-addon.svg)](https://www.npmjs.com/package/finalize-addon)\n\nObject [finalization](https://en.wikipedia.org/wiki/Finalizer) based on [N-API](https://nodejs.org/api/n-api.html) for Node.js v8.6.0+.  \nIn a nutshell, it allows you to register a callback which will be executed when/if \nobservable object becomes eligible for garbage collection. \n\n## Installation\n\n```sh\nnpm install finalize-addon\n```\n\n## Usage\n\n```javascript\nconst finalize = require('finalize-addon')\nconst finalizeCallback = () =\u003e {\n  // warn if fd/sockets are left open, etc\n}\n\nfunction main () {\n  const obj = ...\n  finalize(obj, finalizeCallback)\n}\n\nmain()\n// obj is now eligible for garbage collection \n// (un-comment line below to force gc to run (requires `node --expose-gc`))\n// gc() \n```\n\n\u003e `require`ing N-API addon in Node.js \u003c v10.0.0 results in `Warning: N-API is an experimental feature and could change at any time.`. \nUse `NODE_NO_WARNINGS=1 node ...` or `node --no-warnings ...` to suppress.\n\n## License\n\nAll code, unless specified otherwise, is licensed under the [MIT](LICENSE) license.  \nCopyright (c) 2018 Stanley Shyiko.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshyiko%2Fnode-finalize-addon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshyiko%2Fnode-finalize-addon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshyiko%2Fnode-finalize-addon/lists"}