Inaccurately matches against other ports for unix.
AndrewSouthpaw opened this issue · comments
Andrew Smith commented
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