npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

proc-killer

v1.0.3

Published

This is a simple cli application that allows you to kill processes given a port number either through flags or an interactive, prompt led cli interaction.

Downloads

235

Readme

Welcome to Proc-Killer

A lightweight package that searches and ends processes for linux/macos

The problem this solves

Have you ever worked on a project and found yourself not being able to interface with node processes? In other words, whether it be using the exec function from node's child process module, automating testing, or just having the need to programmatically control processes because of the lack of interfacing with that process, this simple package solves that problem in a few ways.

Lastly, when I say lack of interfacing I am refering to, primarily, when you, for one use case, run npm run start on a js/ts application and are not able to ctrl + c out of it to consequently end the process.

The 3 ways you can use this package

1. Method one (interactive)

  1. Going into the package in node_modules, copying and pasting the code, or cloning the repo here
  2. Running npm install if cloning the repo
  3. Creating a shortcut for your desktop that allows you to run this script and access the prompt based CLI.

[!NOTE] To assist with this step, I have added pictures/code to walk through the steps of setting this shortcut up to interface with the cli prompts on linux.

  1. First cd into this folder and run the command chmod +x index.ts (this gives it executable permissions)
  2. Then create a script that invokes this index.ts. You can add this file anywhere on your machine, just ensure it is an .sh file.
  3. In this .sh file you just created, add the following code:
 kill-process.sh
#!/bin/bash
 echo "starting application..."
 cd path/to/this/package
 npm run start
 echo "application successfully run"
  1. Then proceed to run the chmod +x kill-process.sh command to make this file executable.
  2. Lastly, go to Desktop directory and create a file named Kill-Process.desktop and paste the following code:
[Desktop Entry]
 Name=Kill-Process //(or whatever you want)
 Exec=gnome-terminal -e "path/to/the/.sh/file/you/just/made"
 Type=Application
 Terminal=true
  1. Now when you go to double click this desktop shortcut, ensure you give it permission to Launch as program when it prompts you, and with that you are done.
  • What this does is create a shortcut which executes a script (.sh file) that executes the index.ts file.

2. Method two

  1. Going into the package in node_modules, copying and pasting the code, or cloning the repo here
  2. Running npm install if cloning the repo
  3. Running one of the following commands:
  • npm start with no flags to invoke prompt based interaction with this application
  • npm start -- --<port> Will immediately do a search and end process at that port.
  • npm startjs -- --<port>
  • npx ts-node dev/index.ts --<port> same as above except not calling package.json scripts and using ts-node.

3. Method three

  1. npm install -g proc-killer
  2. Running from your terminal pkill --<port> to kill a process

or

  1. npm install proc-killer to locally install for project
  2. npx proc-killer --<port>