Object finalization based on N-API for Node.js v8.6.0+
npm install finalize-addonObject finalization based on N-API for Node.js v8.6.0+.
In a nutshell, it allows you to register a callback which will be executed when/if
observable object becomes eligible for garbage collection.
``sh`
npm install finalize-addon
`javascript
const finalize = require('finalize-addon')
const obj = ...
finalize(obj, () => {
// warn if fd/sockets are left open, etc
})
`
> requireing N-API addon in Node.js < v10.0.0 results in Warning: N-API is an experimental feature and could change at any time.. NODE_NO_WARNINGS=1 node ...
Use or node --no-warnings ...` to suppress.
All code, unless specified otherwise, is licensed under the MIT license.
Copyright (c) 2018 Stanley Shyiko.