Terminate Process on a Port from Command Line
Once a week I have to deal with a zombie process or try to start a process that's already running on its designated port. In most cases I use macOS's Activity Monitor to kill the process, which is time-consuming. What if we could just kill a process on a given port from command line? Well, we can!
To terminate a process on a given port, install kill-port
and starting nuking those zombies via:
# yarn global add kill-port
# Kill processes on multiple ports
kill-port 6060 8000
If you want to programmatically kill a port that you want to ensure your app will run on, you can do that as well:
const kill = require('kill-port')
kill(6060, 'tcp')
.then(console.log)
.catch(console.log)
I look forward to incorporating this library into my Node.js sites so that I can clear the way for a given port and avoid zombie processes.
You've probably heard the talk around the water cooler about how promises are the future. All of the cool kids are using them, but you don't see what makes them so special. Can't you just use a callback? What's the big deal? In this article, we'll...
If you follow me on Twitter, you know that I've been working on a super top secret mobile application using Appcelerator Titanium. The experience has been great: using JavaScript to create easy to write, easy to test, native mobile apps has been fun. My...
Remember the old days of DHTML and effects that were an achievement to create but had absolutely no value? Well, a trailing mouse cursor script is sorta like that. And I'm sorta the type of guy that creates effects just because I can.
Last week I showed you how you could style selected text with CSS. I've searched for more interesting CSS style properties and found another: INPUT
placeholder styling. Let me show you how to style placeholder text within INPUT
elements with some unique CSS code.
The CSS
Firefox...