Skip to content

Get process info using executable name, no native modules required

License

Notifications You must be signed in to change notification settings

pendo324/get-process-by-name-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Get process info using executable name, no native modules required

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published