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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tripoloski/find-process

v0.0.2

Published

Find OS processes by file/directory path (cross-platform)

Readme

@tripoloski/find-process

A cross-platform Node.js library for finding running processes based on their open file paths. Supports Windows (using Sysinternals Handle), Linux, and macOS.

Features

  • Find processes by matching fragments in their open file paths
  • Cross-platform support (Windows, Linux, macOS)
  • Case-sensitive or case-insensitive search
  • Filter by process name
  • Get detailed process information (PID, name, open files)
  • Check if process is running and kill processes

Installation

npm install @tripoloski/find-process
# or
yarn add @tripoloski/find-process
# or
pnpm add @tripoloski/find-process

Usage

Basic Usage

import { ProcessFinder } from '@tripoloski/find-process';

const finder = new ProcessFinder();

// Find processes with 'lock' in their open file paths
const processes = await finder.findByPathFragment({
  fragment: 'lock'
});

console.log(processes);
// [
//   Process { pid: 1234, name: 'node', files: ['C:\\temp\\app.lock'] },
//   Process { pid: 5678, name: 'notepad', files: ['C:\\temp\\document.lock'] }
// ]

With Callback

finder.findByPathFragment(
  { fragment: 'lock' },
  (error, processes) => {
    if (error) {
      console.error('Error:', error.message);
    } else {
      console.log(processes);
    }
  }
);

Filter by Process Name

const processes = await finder.findByPathFragment({
  fragment: 'temp',
  processName: 'node' // Only find processes named 'node'
});

Case-Sensitive Search

const processes = await finder.findByPathFragment({
  fragment: 'Temp',
  caseSensitive: true
});

API

ProcessFinder

Main class for finding processes.

findByPathFragment(options: IOptions): Promise<Process[]>

Finds all running processes that have the given string matching any part of their open file paths.

Options:

  • fragment (string, required): The string fragment to search for in file paths
  • processName (string, optional): Filter results to only include processes with this name
  • caseSensitive (boolean, optional): Whether the search should be case-sensitive (default: false)

findByPathFragment(options: IOptions, callback: ICallback): void

Same as above but uses a callback instead of a promise.

Callback signature: (error: Error | null, processes: Process[]) => void

Process

Represents a found process with its details.

getPid(): number

Returns the process ID.

getProcessName(): string

Returns the process name.

getOpenFiles(): readonly string[]

Returns an array of file paths that the process has open.

isRunning(): boolean

Checks if the process is still running.

kill(force = false): boolean

Kills the process.

  • force (boolean): On Windows, uses taskkill /F. On Unix, sends SIGKILL instead of SIGTERM (default: false)

Returns true if the process was successfully killed or was already dead, false otherwise.

Platform Support

  • Windows: Uses Sysinternals Handle tool (included in the package)
  • Linux/macOS: Uses the lsof command

Follow me on Telegram: Tripoloski Channel