
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
node-disposable
Advanced tools
This module provides an object with finalizer and IDisposable interface via .Net for NodeJS.
// TypeScript
import Disposable = require('node-disposable');
class Object extends Disposable.Object {
public invoke() {
this.__throwIfDisposed();
console.log('invoke');
}
public __finalize(disposing) {
console.log('finalize: ' + (disposing ? 'dispose' : 'exit'));
}
}
export = Object;
__finalize method is called on either calling dispose method, object is GC'd or process.exit event is fired.
var obj = new Object();
obj.dispose(); // __finalize will be called.
import Disposable = require('node-disposable');
Disposable.using(new Object(), obj => {
// codes using Object
});
// Object is disposed.
Finalizer won't run when the node process is terminated by SIGINT. To handle this problem, call finalize method on SIGINT.
import Disposable = require('node-disposable');
process.on('SIGINT', function(){
Disposable.finalize();
process.exit(-1);
});
Dispose object.
Finalizer method.
disposing:true Dispose method called. disposing:false process.exit.
Throws an error if object is disposed.
ture if object is disposed.
Execute callback with an obj. The obj will be disposed after the callback.
Execute finalizers of all objects allocated.
Register IDisposable object that will be handled as a disposable object.
FAQs
IDisposable for Node.js
We found that node-disposable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.