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
npm install find-process
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
128 Stars
125 Commits
43 Forks
4 Watching
1 Branches
11 Contributors
Updated on 08 Nov 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-4.3%
317,057
Compared to previous day
Last week
3.1%
1,791,095
Compared to previous week
Last month
10.3%
7,471,404
Compared to previous month
Last year
56.7%
69,564,022
Compared to previous year
With find-process, you can:
We have covered the difference of main OS platform, including Mac OSX, 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
Usage:
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 })
Promise<Array> find(type, value, [options])
Arguments
type
the type of find, support: port|pid|namevalue
the value of type, can be RegExp if type is nameoptions
this can either be the object described below or boolean to just set strict mode
options.strict
the optional strict mode is for checking port, pid, or name exactly matches the given one. (on Windows, .exe
can be omitted)options.logLevel
set the logging level to trace|debug|info|warn|error
. In practice this lets you silence a netstat warning on Linux.Return
The return value of find-process is Promise, if you use co you can use yield find(type, value)
directly.
The resolved value of promise is an array list of process ([]
means it may be missing on some platforms):
[{
pid: <process id>,
ppid: [parent process id],
uid: [user id (for *nix)],
gid: [user group id (for *nix)],
name: <command/process name>,
bin: <execute path (for *nix)>,
cmd: <full command with args>
}, ...]
Find process which is listening port 80.
1const find = require('find-process'); 2 3find('port', 80) 4 .then(function (list) { 5 if (!list.length) { 6 console.log('port 80 is free now'); 7 } else { 8 console.log('%s is listening port 80', list[0].name); 9 } 10 })
Find process by pid.
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 });
Find all nginx process.
1const find = require('find-process'); 2 3find('name', 'nginx', true) 4 .then(function (list) { 5 console.log('there are %s nginx process(es)', list.length); 6 });
Find all nginx processes on Linux without logging a warning when run as a user who isn't root.
1const find = require('find-process'); 2 3find('name', 'nginx', {strict: true, logLevel: 'error'}) 4 .then(function (list) { 5 console.log('there are %s nginx process(es)', list.length); 6 });
We're welcome to receive Pull Request of bugfix or new feature, but please check the list before sending PR:
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 4/18 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
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 2024-11-18
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