File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -37,15 +37,16 @@ const findAndKillProcess = (port) => {
3737 ? stdout
3838 . split ( '\n' )
3939 . filter ( line => line . includes ( 'LISTEN' ) )
40- . map ( line => line . trim ( ) . split ( / \s + / ) )
41- : stdout . split ( '\n' ) . map ( line => line . trim ( ) ) . filter ( line => line ) ;
40+ . map ( line => line . trim ( ) . split ( / \s + / ) . pop ( ) )
41+ . filter ( Boolean )
42+ : stdout . split ( '\n' ) . map ( line => line . trim ( ) ) . filter ( Boolean ) ;
4243
4344 if ( pids . length === 0 ) {
4445 resolve ( `No process found on port ${ port } ` ) ;
4546 return ;
4647 }
4748
48- console . log ( `Processes on port ${ port } have PIDs: ${ pids . join ( ', ' ) } ` ) ;
49+ console . log ( `Found processes on port ${ port } with PIDs: ${ pids . join ( ', ' ) } ` ) ;
4950
5051 Promise . all (
5152 pids . map ( pid =>
Original file line number Diff line number Diff line change 11{
22 "name" : " kill-port-process-cli" ,
3- "version" : " 1.0.12 " ,
3+ "version" : " 1.0.13 " ,
44 "description" : " A CLI tool to kill processes by port" ,
55 "main" : " index.js" ,
66 "bin" : {
You can’t perform that action at this time.
0 commit comments