destruction-notifiable
0.0.3 • Public • Published destruction-notifiable-js
Node.js destruction notifiable types (N-API).
Usage:
var dn = require('destruction-notifiable');
function forceGC() {
if (global.gc) {
global.gc();
} else {
console.warn('No GC hook! Start your program as `node --expose-gc ./test.js`.');
}
}
function test() {
var obj = new dn.Destructible(42, function(id) {
console.log("object destructed " + id);
});
}
test();
forceGC();
Run:
node --expose-gc ./test.js
Expected output:
object destructed 42
Versions
Current Tags
- VersionDownloads (Last 7 Days)
- 0.0.3
2
Version History
Package Sidebar
Install
npm i destruction-notifiable
Weekly Downloads