Installations
npm install why-is-node-still-running
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
15.4.0
NPM Version
7.0.7
Contributors
Unable to fetch Contributors
Languages
TypeScript (100%)
Developer
Download Statistics
Total Downloads
98,005
Last Day
44
Last Week
171
Last Month
1,904
Last Year
25,136
GitHub Statistics
23 Stars
12 Commits
2 Forks
3 Watching
1 Branches
1 Contributors
Bundle Size
3.05 kB
Minified
1.30 kB
Minified + Gzipped
Package Meta Information
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
Total Downloads
Cumulative downloads
Total Downloads
98,005
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
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
🏃 why-is-node-still-running
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
Installation
1npm i -D why-is-node-still-running
Usage
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()
.
Example of usage with Jest
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).
License
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
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: ISC License: LICENSE:0
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
- Warn: no fuzzer integrations found
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
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 1 are checked with a SAST tool
Reason
23 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
Score
1.7
/10
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