@pendo324/get-process-by-name

1.0.1 • Public • Published

npm version

Usage

Just require the module

const { getProcessByName } = require('get-process-by-name');

await getProcessByName(<executableName>):

  • executableName (string, required): the name of the executable that you want the info for. Omitting this argument (or supplying an executable name that doesn't have running processes) will return an empty list.

  • Returns an Array of processes (i.e. Promise<process[]>) where imagename (executable name) equals executableName

process Object structure:

{
    imageName: string, // executable name (usually *.exe)
    pid: number, // process id
    sessionName: string,
    sessionNumber: number,
    memUsage: number, // memory consumption, in bytes
    status: string,
    userName: string,
    cpuTime: string, // CPU time in the format HH:MM:SS, where MM and SS are between 0 and 59 and HH is any unsigned number
    windowTitle: string
}

Todo (pull requests welcome!)

  • Add Linux support
  • Add Mac support
  • Add tests
  • Add automatic build server

Readme

Keywords

none

Package Sidebar

Install

npm i @pendo324/get-process-by-name

Weekly Downloads

12

Version

1.0.1

License

MIT

Unpacked Size

5.98 kB

Total Files

6

Last publish

Collaborators

  • pendo324