Gathering detailed insights and metrics for why-is-node-still-running
Gathering detailed insights and metrics for why-is-node-still-running
npm install why-is-node-still-running
Typescript
Module System
Node Version
NPM Version
TypeScript (100%)
Total Downloads
98,005
Last Day
44
Last Week
171
Last Month
1,904
Last Year
25,136
23 Stars
12 Commits
2 Forks
3 Watching
1 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
1.0.0
Package Id
why-is-node-still-running@1.0.0
Unpacked Size
27.73 kB
Size
7.28 kB
File Count
12
NPM Version
7.0.7
Node Version
15.4.0
Cumulative downloads
Total Downloads
Last day
76%
44
Compared to previous day
Last week
-49.3%
171
Compared to previous week
Last month
8.4%
1,904
Compared to previous month
Last year
-38.6%
25,136
Compared to previous year
This is a port of mafintosh' why-is-node-running module to TypeScript, with modernized syntax and no dependencies.
1const { whyIsNodeStillRunning } = require('why-is-node-still-running'); 2const { createServer } = require('net'); 3 4const server = createServer(); 5server.listen(0); 6 7whyIsNodeStillRunning(); 8// There are 2 handle(s) keeping the process running
1npm i -D why-is-node-still-running
Always import this module first so that the asynchronous hook can be setup.
The hook will log to the console by default, but you can provide it with a
custom logger that implements error()
.
Sometimes Jest complains that there are asynchronous operations still hanging
after the tests have been completed. When the --detectOpenHandles
flag gives
no output, you can try using this module to help pinpoint the cause:
1import { whyIsNodeStillRunning } from 'why-is-node-still-running'; 2 3afterAll(async () => { 4 // Do your actual cleanup here 5 // [...] 6 7 // Print the handles still opened 8 await new Promise(resolve => setTimeout(() => { 9 whyIsNodeStillRunning(); 10 resolve(); 11 }, 4000)); 12});
Don't forget to run Jest with --useStderr
to show console output.
Alternatively, you can use this module to print some information about the stack regularly while the tests are running (e.g. see this comment).
1Copyright (c) 2020-present, cheap glitch 2 3Permission to use, copy, modify, and/or distribute this software for any purpose 4with or without fee is hereby granted, provided that the above copyright notice 5and this permission notice appear in all copies. 6 7THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 8REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 9FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 10INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS 11OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 12TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 13THIS SOFTWARE.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/11 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
23 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-01-13
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