Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

wtfnode

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wtfnode - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

test.js

22

index.js

@@ -84,3 +84,4 @@ #!/usr/bin/env node

process.on('SIGINT', function () {
function dump() {
console.log('[WTF Node?] open handles:');

@@ -162,7 +163,20 @@

}
process.exit();
});
}
function init() {
process.on('SIGINT', function () {
try { dump(); }
catch (e) { console.error(e); }
process.exit();
});
}
module.exports = {
dump: dump,
init: init
};
if (module === require.main && process.argv[2]) {
init();
var fn = process.argv[2], PATH = require('path');

@@ -169,0 +183,0 @@ if (!/^\//.test(fn)) {

2

package.json
{
"name": "wtfnode",
"version": "0.1.0",
"version": "0.2.0",
"description": "Utility to help find out why Node isn't exiting",

@@ -5,0 +5,0 @@ "repository": {

@@ -37,12 +37,18 @@ # What?

# Usage
# Command line usage
You can install as a global module (`npm install -g wtfnode`) and call a node script manually: `wtfnode <yourscript>`
If you do this, `wtfnode` will load itself, then `require()` the script you specified.
If you do this, `wtfnode` will load itself, then `require()` the script you specified. When you are ready, send SIGINT (Ctrl+C). The process will exit, and the active handles at the time of exit will be printed out.
Alternately, you can load it as a module, using `require()` at the entry point of your own app: `require('wtfnode')`; if you do this, you only need install it locally.
# Module usage
Once `wtfnode` is loaded, all you need do is send SIGINT (Ctrl+C). The process will exit, and the active handles at the time of exit will be printed out.
Install as a local module (`npm install wtfnode`).
Require the module: `var wtf = require('wtfnode');`
When you are ready, call `wtf.dump()` to dump open handles. Note that if you call this from a timer, the timer itself may show up!
**Important**: Require at the entry point of your application. You must do this before loading / referencing even native node modules, or certain hooks may not be effective.
# Caution

@@ -49,0 +55,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc