Installations
npm install @crossan007/why-is-node-running
Developer Guide
Typescript
No
Module System
CommonJS
Min. Node Version
>=8
Node Version
16.15.1
NPM Version
8.11.0
Score
67.5
Supply Chain
98.6
Quality
75.1
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Languages
JavaScript (100%)
Developer
mafintosh
Download Statistics
Total Downloads
1,168
Last Day
1
Last Week
3
Last Month
5
Last Year
67
GitHub Statistics
1,882 Stars
72 Commits
45 Forks
19 Watching
1 Branches
16 Contributors
Bundle Size
1.49 kB
Minified
769.00 B
Minified + Gzipped
Package Meta Information
Latest Version
3.0.0
Package Id
@crossan007/why-is-node-running@3.0.0
Unpacked Size
6.66 kB
Size
2.98 kB
File Count
8
NPM Version
8.11.0
Node Version
16.15.1
Total Downloads
Cumulative downloads
Total Downloads
1,168
Last day
-50%
1
Compared to previous day
Last week
50%
3
Compared to previous week
Last month
-16.7%
5
Compared to previous month
Last year
-91.6%
67
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
why-is-node-running
Node is running but you don't know why? why-is-node-running
is here to help you.
Installation
Node 8 and above:
1npm i why-is-node-running -g
Earlier Node versions (no longer supported):
1npm i why-is-node-running@v1.x -g
Usage
1const log = require('why-is-node-running') // should be your first require 2const net = require('net') 3 4function createServer () { 5 const server = net.createServer() 6 setInterval(function () {}, 1000) 7 server.listen(0) 8} 9 10createServer() 11createServer() 12 13setTimeout(function () { 14 log() // logs out active handles that are keeping node running 15}, 100)
Save the file as example.js
, then execute:
1node ./example.js
Here's the output:
There are 5 handle(s) keeping the process running
# Timeout
/home/maf/dev/node_modules/why-is-node-running/example.js:6 - setInterval(function () {}, 1000)
/home/maf/dev/node_modules/why-is-node-running/example.js:10 - createServer()
# TCPSERVERWRAP
/home/maf/dev/node_modules/why-is-node-running/example.js:7 - server.listen(0)
/home/maf/dev/node_modules/why-is-node-running/example.js:10 - createServer()
# Timeout
/home/maf/dev/node_modules/why-is-node-running/example.js:6 - setInterval(function () {}, 1000)
/home/maf/dev/node_modules/why-is-node-running/example.js:11 - createServer()
# TCPSERVERWRAP
/home/maf/dev/node_modules/why-is-node-running/example.js:7 - server.listen(0)
/home/maf/dev/node_modules/why-is-node-running/example.js:11 - createServer()
# Timeout
/home/maf/dev/node_modules/why-is-node-running/example.js:13 - setTimeout(function () {
Important Note!
unref
ed timers do not prevent the Node process from exiting. If you are running with Node v11.0.0 and above, unref
ed timers will not be listed in the above list. Unfortunately, this is not supported in node versions below v11.0.0.
CLI
You can also run why-is-node-running
as a standalone if you don't want to include it inside your code. Sending SIGUSR1
/SIGINFO
signal to the process will produce the log. (Ctrl + T
on macOS and BSD systems)
1why-is-node-running /path/to/some/file.js
probing module /path/to/some/file.js
kill -SIGUSR1 31115 for logging
To trigger the log:
kill -SIGUSR1 31115
Require CLI Option
You can also use the node -r
option to include why-is-node-running
:
1node -r why-is-node-running/include /path/to/some/file.js
The steps are otherwise the same as the above CLI section
License
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
packaging workflow detected
Details
- Info: Project packages its releases by way of GitHub Actions.: .github/workflows/publish.yml:6
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Info: jobLevel 'contents' permission set to 'read': .github/workflows/publish.yml:9
- Warn: no topLevel permission defined: .github/workflows/publish.yml:1
- Info: no jobLevel write permissions found
Reason
5 commit(s) and 4 issue activity found in the last 90 days -- score normalized to 7
Reason
Found 4/30 approved changesets -- score normalized to 1
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/mafintosh/why-is-node-running/publish.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/mafintosh/why-is-node-running/publish.yml/master?enable=pin
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 19 are checked with a SAST tool
Score
5.3
/10
Last Scanned on 2025-01-06
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More