Gathering detailed insights and metrics for find-process
Gathering detailed insights and metrics for find-process
Gathering detailed insights and metrics for find-process
Gathering detailed insights and metrics for find-process
has-flag
Check if argv has a specific flag
@types/find-process
Stub TypeScript definitions entry for find-process, which provides its own types definitions
@flemist/find-process
Cross-platform find or wait processes by predicate func. With minimum code using ps (for Unix) and wmic (for Windows)
process-finder
Find processes using a simple API
npm install find-process
Typescript
Module System
Node Version
NPM Version
TypeScript (77.96%)
JavaScript (22.04%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
132 Stars
156 Commits
48 Forks
2 Watchers
2 Branches
14 Contributors
Updated on Jul 05, 2025
Latest Version
2.0.0
Package Id
find-process@2.0.0
Unpacked Size
76.19 kB
Size
19.87 kB
File Count
41
NPM Version
10.8.2
Node Version
20.19.3
Published on
Jul 05, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
With find-process, you can:
We have covered the difference of main OS platform, including macOS, Linux, Windows and Android (with Termux).
Install find-process as a CLI tool:
1$ npm install find-process -g
Usage:
1 2 Usage: find-process [options] <keyword> 3 4 5 Options: 6 7 -V, --version output the version number 8 -t, --type <type> find process by keyword type (pid|port|name) 9 -p, --port find process by port 10 -h, --help output usage information 11 12 Examples: 13 14 $ find-process node # find by name "node" 15 $ find-process 111 # find by pid "111" 16 $ find-process -p 80 # find by port "80" 17 $ find-process -t port 80 # find by port "80" 18
Example:
You can use npm to install:
1$ npm install find-process --save
1import find, { ProcessInfo, FindConfig } from "find-process"; 2 3// Find process by PID 4find('pid', 12345) 5 .then((list: ProcessInfo[]) => { 6 console.log(list); 7 }) 8 .catch((err: Error) => { 9 console.log(err.stack || err); 10 }); 11 12// With configuration options 13const config: FindConfig = { 14 strict: true, 15 logLevel: 'warn' 16}; 17 18find('name', 'nginx', config) 19 .then((list: ProcessInfo[]) => { 20 console.log(`Found ${list.length} nginx processes`); 21 });
1const find = require('find-process'); 2 3find('pid', 12345) 4 .then(function (list) { 5 console.log(list); 6 }, function (err) { 7 console.log(err.stack || err); 8 })
1function find(type: 'port' | 'pid' | 'name', value: string | number, options?: FindConfig | boolean): Promise<ProcessInfo[]>
type
- The type of search, supports: 'port' | 'pid' | 'name'
value
- The value to search for. Can be RegExp if type is 'name'
options
- Optional configuration object or boolean for strict mode
options.strict
- Optional strict mode for exact matching of port, pid, or name (on Windows, .exe
can be omitted)options.logLevel
- Set logging level to 'trace' | 'debug' | 'info' | 'warn' | 'error'
. Useful for silencing netstat warnings on Linuxoptions.skipSelf
- Skip the current process when searching by nameReturns a Promise that resolves to an array of process information ([]
means no processes found):
1interface ProcessInfo { 2 pid: number; // Process ID 3 ppid: number; // Parent process ID 4 uid?: number; // User ID (Unix systems) 5 gid?: number; // Group ID (Unix systems) 6 name: string; // Command/process name 7 bin?: string; // Executable path (Unix systems) 8 cmd: string; // Full command with arguments 9}
The package includes complete TypeScript definitions:
1import { ProcessInfo, FindConfig, FindMethod } from 'find-process';
1import find from 'find-process'; 2 3find('port', 80) 4 .then((list) => { 5 if (!list.length) { 6 console.log('Port 80 is free now'); 7 } else { 8 console.log(`${list[0].name} is listening on port 80`); 9 } 10 });
1import find from 'find-process'; 2 3find('pid', 12345) 4 .then((list) => { 5 console.log(list); 6 }) 7 .catch((err) => { 8 console.log(err.stack || err); 9 });
1import find from 'find-process'; 2 3find('name', 'nginx', true) 4 .then((list) => { 5 console.log(`There are ${list.length} nginx process(es)`); 6 });
1import find from 'find-process'; 2 3find('name', 'nginx', { strict: true, logLevel: 'error' }) 4 .then((list) => { 5 console.log(`Found ${list.length} nginx process(es)`); 6 });
1import find from 'find-process'; 2 3async function findNodeProcesses() { 4 try { 5 const processes = await find('name', 'node'); 6 console.log(`Found ${processes.length} Node.js processes`); 7 8 processes.forEach(proc => { 9 console.log(`PID: ${proc.pid}, Name: ${proc.name}, CMD: ${proc.cmd}`); 10 }); 11 } catch (error) { 12 console.error('Error finding processes:', error); 13 } 14}
1# Clone the repository 2git clone https://github.com/yibn2008/find-process.git 3cd find-process 4 5# Install dependencies 6pnpm install 7 8# Build the project 9pnpm run build 10 11# Run tests 12pnpm test 13 14# Run linting 15pnpm run lint
pnpm run build
- Compile TypeScript to JavaScriptpnpm run dev
- Watch mode for developmentpnpm test
- Run testspnpm run lint
- Run linting and fix issuespnpm run type-check
- TypeScript type checkingpnpm run check-version
- Verify version consistencypnpm run update-history
- Update HISTORY.md with recent commitsWe welcome Pull Requests for bug fixes and new features. Please check the following before submitting a PR:
pnpm run build
completes successfullyNo vulnerabilities found.
Reason
11 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 10
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 3/25 approved changesets -- score normalized to 1
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
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