Created
January 23, 2023 14:38
-
-
Save Cauen/f8b63507beea8fc35dd50b4a33851693 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Name: Port kill | |
// Description: Enter port number to kill process listening on port. | |
// Author: kyo young | |
// GitHub: | |
import '@johnlindquist/kit'; | |
const killPort = await npm('kill-port'); | |
const port = await arg('Enter port to kill') | |
const containerClassName = 'flex justify-center items-center text-4xl h-full' | |
try { | |
await killPort(port, 'tcp') | |
await div(`🤖 listening on port ${port} has been killed.`,containerClassName); | |
} catch (error) { | |
console.error(error); | |
await div(` | |
🛰️ ${error.message} | |
`,containerClassName) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment