Skip to content

Inaccurately matches against other ports for unix. #67

@AndrewSouthpaw

Description

@AndrewSouthpaw

Repro:

Run lsof -i -P and pick a port that is running where no substring of the port is running, e.g.

Google    62775 andrew   89u  IPv4 ...  TCP 192.168.0.0:49302->...:443 (ESTABLISHED)
# no port 9302

Then run kill-port 9302, it prints:

$ npx kill-port 9302
Process on port 9302 killed

This is because the regex is incorrect:

https://github.com/tiaanduplessis/kill-port/blob/master/index.js#L39

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions