Skip to content

Conversation

@Damilope
Copy link

Problem

Find by port doesn't work on some MacOS devices because the pid column from netstat contained processname:pid whereas the code was expecting just pid, which returns a NaN when run through parseInt(...)

I think it's the cause of issue 84.

Proposed change

Try to extract pid from processname:pid using a RegExp capturing group matching decimals :d and if present, parse into an integer, otherwise, use the cell as is.

Also added a check to only resolve the promise if the parsed process is a number, and reject otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant