
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
node-processlist
Advanced tools
The node-processlist module provides detailed information about processes. It uses the tasklist command to get a list of currently running processes on Windows.
npm install node-processlist
The node-processlist module can be accessed using:
// CommonJS
const processlist = require('node-processlist');
or:
// ES6 Modules
import processlist from 'node-processlist';
The ProcessInfo object contains information about the process.
By default, only the following properties are availabe:
namepidsessionNamesessionNumbermemUsageWhen processlist.getProcesses() is called with the modules option set to true, the object will contain the following properties:
namepidmodulesWhen that method is called with the services option set to true, the object will contain the following properties:
namepidservicesWhen that method is called with the apps option set to true, the object will contain the following properties:
namepidmemUsagepackageNameWhen that method is called with the verbose option set to true, the object will contain the following properties:
namepidsessionNamesessionNumbermemUsagestatususernamecpuTimewindowTitleAdditionally, if the apps option is also true, the packageName property is included.
The name of the process.
The process identifier (PID).
The session name.
The session number.
The memory usage of the process measured in bytes.
The process status. It can be 'Running', 'Suspended', 'Not Responding' or 'Unknown'.
The user name.
The CPU time usage of the process in seconds.
The title of the window in which the process is running.
The DLL modules loaded for the process.
The services running in the process.
The package name.
Filters specify the types of processes to include in or exclude from the match.
| Filter Name | Valid Operators | Valid value(s) |
|---|---|---|
STATUS | eq, ne | Running | Not Responding | Unknown. This filter isn't supported if you specify a remote system. |
IMAGENAME | eq, ne | Image name |
PID | eq, ne, gt, lt, ge, le | PID value |
SESSION | eq, ne, gt, lt, ge, le | Session number |
SESSIONNAME | eq, ne | Session name |
CPUTIME | eq, ne, gt, lt, ge, le | CPU time in the format HH:MM:SS, where MM and SS are between 0 and 59 and HH is any unsigned number |
MEMUSAGE | eq, ne, gt, lt, ge, le | Memory usage in KB |
USERNAME | eq, ne | Any valid user name (<user> or <domain\user>) |
SERVICES | eq, ne | Service name |
WINDOWTITLE | eq, ne | Window title. This filter isn't supported if you specify a remote system. |
MODULES | eq, ne | DLL name |
The following example gets all processes that have a memory usage greater than 20 MB. It uses the MEMUSAGE filter, which finds processes using the memUsage property. The gt operator gets only the processes with a value greater than 20,000 KB.
import { getProcesses } from 'node-processlist';
(async () => {
const processes = await getProcesses({
filters: ['MEMUSAGE gt 20000']
});
console.log(processes);
/*
Prints:
[
{
name: 'svchost.exe',
pid: 664,
sessionName: 'Services',
sessionNumber: 0,
memUsage: 32534528
},
...
]
*/
})();
The following example gets all processes that have a window title that begins with 'Microsoft'.
import { getProcesses } from 'node-processlist';
(async () => {
const processes = await getProcesses({
filters: ['WINDOWTITLE eq Microsoft*']
});
console.log(processes);
/*
Prints:
[
{
name: 'TextInputHost.exe',
pid: 14164,
sessionName: 'Console',
sessionNumber: 4,
memUsage: 46342144
},
...
]
*/
})();
options <Object>
system <string> The name or IP address of a remote computer.username <string> The user name of the remote computer.password <string> The password of the account that is specified in the username option.modules <boolean> | <string> If true, lists all DLL modules loaded for each process. Default: false.services <boolean> If true, lists all services running for each process. Default: false.apps <boolean> If true, gets store apps. Default: false.verbose <boolean> If true, gets detailed information for each process. Default: false.filters <string[]> An array of filters.Gets the processes on a local or remote computer.
The modules, services and apps options can not be used together.
The verbose option only works when modules and services options are false.
The following example gets the modules loaded for each process:
import { getProcesses } from 'node-processlist';
(async () => {
const processes = await getProcesses({ modules: true });
console.log(processes);
/*
Prints:
[
{
name: 'tasklist.exe',
pid: 13520,
modules: [
'ntdll.dll', 'KERNEL32.DLL', 'KERNELBASE.dll',
'ADVAPI32.dll', 'msvcrt.dll', 'sechost.dll',
'RPCRT4.dll', 'USER32.dll', 'win32u.dll',
'GDI32.dll', 'gdi32full.dll', 'msvcp_win.dll',
'ucrtbase.dll', 'OLEAUT32.dll', 'combase.dll',
'WS2_32.dll', 'SHLWAPI.dll', 'VERSION.dll',
'framedynos.dll', 'dbghelp.dll', 'SspiCli.dll',
'srvcli.dll', 'netutils.dll', 'MPR.dll',
'IMM32.DLL', 'kernel.appcore.dll', 'bcryptPrimitives.dll',
'clbcatq.dll', 'wbemprox.dll', 'wbemcomn.dll',
'Winsta.dll', 'wbemsvc.dll', 'fastprox.dll',
'amsi.dll', 'USERENV.dll', 'profapi.dll',
'MpOav.dll', 'ole32.dll', 'AMSIExt.dll',
'WINTRUST.dll', 'PSAPI.DLL', 'CRYPT32.dll',
'SHELL32.dll', 'MSASN1.dll', 'mccoreps.dll',
'CRYPTSP.dll', 'rsaenh.dll', 'bcrypt.dll',
'CRYPTBASE.dll', 'imagehlp.dll', 'gpapi.dll',
'cryptnet.dll', 'mfevtpa.dll', 'mfehida.dll',
'mfemmsa.dll', 'sxs.dll', 'windows.storage.dll',
'Wldp.dll', 'SHCORE.dll', 'wmiutils.dll'
]
},
...
]
*/
})();
pid <number> The process ID.options <Object> Accepts the same options as processlist.getProcesses().null if there is no process with the specified pid.Finds a process using PID.
The following example uses the process ID to get detailed information about the process:
import { getProcessById } from 'node-processlist';
(async () => {
const processinfo = await getProcessById(14164, { verbose: true });
console.log(processinfo);
/*
Prints:
{
name: 'TextInputHost.exe',
pid: 14164,
sessionName: 'Console',
sessionNumber: 4,
memUsage: 46395392,
status: 'Running',
username: 'MYCOMPUTER\\gabri',
cpuTime: 2,
windowTitle: 'Microsoft Text Input Application'
}
*/
})();
name <string> The process name.options <Object> Accepts the same options as processlist.getProcesses().Finds processes using the process name.
The following example displays all Explorer.exe (Explorer) processes:
import { getProcessesByName } from 'node-processlist';
(async () => {
const processes = await getProcessesByName('explorer.exe');
console.log(processes);
/*
Prints:
[
{
name: 'explorer.exe',
pid: 8328,
sessionName: 'Console',
sessionNumber: 4,
memUsage: 140410880
},
...
]
*/
})();
FAQs
Gets a list of currently running processes on Windows.
The npm package node-processlist receives a total of 49 weekly downloads. As such, node-processlist popularity was classified as not popular.
We found that node-processlist demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.