Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
active-handles
Advanced tools
Prints out information about the process's active handles, including function source and location
Prints out information about the process's active handles, including function source and location.
var activeHandles = require('active-handles');
// run your program, launch a server, call setTimeout or similar
// in order to create some handles and then call the below
activeHandles.print();
Shows handles of multiple types created via examples/mixed.js
npm install active-handles
For any version <= v1.6.2
the setInterval
function has to be hooked in order for this to work for setInterval
created handles.
In order to do that call activeHandles.hookSetInterval()
before any calls to setInterval
occurr. This is
demonstrated in this example.
Handles of net
and http
modules log handles from inside core instead of your handle, leaving you to hunt down
where you created these connections.
Gathers information about all currently active handles.
Active handles are obtained via process._getActiveHandles
and location and name of each is resolved.
Name | Type | Argument | Description |
---|---|---|---|
options | Object | ||
opts.handles | Array.<Object>= |
<optional> | handles to get info for (default: |
opts.source | Boolean |
<optional> | include source (default: |
opts.highlight | Boolean |
<optional> | include highlighted source (default: |
opts.attachHandle | Boolean |
<optional> | attaches inspected handle for further inspection (default: |
handles each with the following properties
handle.msecs timeout specified for the handle
handle.fn the handle itself
handle.name the name of the function, for anonymous functions this is the name it was assigned to
handle.anonymous true if the function was anonymous
handle.source the raw function source
handle.highlighted the highlighted source
handle.location location information about the handle
handle.location.file full path to the file in which the handle was defined
handle.location.line line where the handle was defined
handle.location.column column where the handle was defined
handle.location.inferredName name that is used when function declaration is anonymous
Hooks setInterval
calls in order to expose the passed handle.
NOTE: not needed in io.js >=v1.6.2
and will not hook for those versions.
The handle is wrapped. In older node versions it is not exposed.
The hooked version of setInterval
will expose the wrapped callback
so its information can be retrieved later.
Convenience function that first calls @see activeHandles and prints the information to stdout.
Name | Type | Argument | Description |
---|---|---|---|
options | Object | ||
opts.highlight | Boolean |
<optional> | print highlighted source (default: |
generated with docme
A core module which depends only on function-origin
can be used. It behaves exactly like the main module except
that it doesn't merge opts
with default options and provides no highlighting even if highlight
is set in the options.
Additionally it does not include the print
feature.
You can use it as follows:
var activeHandles = require('active-handles/core');
activeHandles();
MIT
FAQs
Prints out information about the process's active handles, including function source and location
We found that active-handles 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.