who

whoport

A simple CLI tool to check if and which PID uses a given port number and optionally kill it.

Showing:

Popularity

Downloads/wk

2

GitHub Stars

25

Maintenance

Last Commit

4mos ago

Contributors

4

Package

Dependencies

5

Size (min+gzip)

38.0KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

npm version GitHub issues

whoport

A simple nodejs based CLI tool to check if and which PID uses a given port number and optionally kill it.

Installation

npm i -g whoport

Compatibility

Tested on:

  • macOS 10.10.5, 10.11.4, 10.14.6
  • Windows 7
  • Debian 7.8 (wheezy)

Due to the use of netstat for Windows operating systems, whoport should also work on Windows Vista and above. (thanks @lewisje for the hint!)

How it works

  • OSX uses lsof to check for processes and kill -9 to kill one or more PIDs.
  • Windows uses netstat to check for processes and taskkill to kill the PID.

Usage

# check and display PID and process name if present
whoport 9090

# kill process which uses port
whoport 9090 -k

FAQ

No process found but something is listening. (OSX)

You need to execute whoport with sudo if a process runs via another or root user. Also see man lsof section "Security".

Contributing

Pull Requests are very welcome!

If you find any issues, please report them via Github Issues and include your nodejs version and OS.

License

(MIT)

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial