Skip to content

Instantly share code, notes, and snippets.

@Cauen
Created January 23, 2023 14:38
Show Gist options
  • Save Cauen/f8b63507beea8fc35dd50b4a33851693 to your computer and use it in GitHub Desktop.
Save Cauen/f8b63507beea8fc35dd50b4a33851693 to your computer and use it in GitHub Desktop.
// 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