# tasklist

> Wrapper for the Windows `tasklist` command. Returns a list of apps and services with their Process ID (PID) for all tasks running on either a local or a remote computer.

Latest version **6.0.0** (published 2026-02-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install tasklist
pnpm add tasklist
yarn add tasklist
bun add tasklist
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 6.0.0 |
| Published | 2026-02-03 |
| First published | 2015-05-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=20 |
| Dependencies | 2 |
| Unpacked size | 25.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 71 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | tasklist, task, list, windows, win, win32, pid, process, processes, services |

## Links

- npm: https://www.npmjs.com/package/tasklist
- Repository: https://github.com/sindresorhus/tasklist
- Homepage: https://github.com/sindresorhus/tasklist#readme
- Issues: https://github.com/sindresorhus/tasklist/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/tasklist

## Dependencies (2)

- [csv](https://npm.io/package/csv.md) ^6.4.1
- [sec](https://npm.io/package/sec.md) ^2.0.0

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 6.0.0 (latest) — 2026-02-03
- 5.0.0 — 2021-08-12
- 4.0.1 — 2019-11-12
- 4.0.0 — 2019-07-07
- 3.1.1 — 2018-08-09
- 3.1.0 — 2017-07-15
- 3.0.0 — 2017-05-01
- 2.1.0 — 2015-11-14
- 2.0.0 — 2015-10-17
- 1.1.0 — 2015-07-13
- 1.0.0 — 2015-05-31

## README

# tasklist

> Wrapper for the Windows [`tasklist`](https://technet.microsoft.com/en-us/library/bb491010.aspx) command. Returns a list of apps and services with their Process ID (PID) for all tasks running on either a local or a remote computer.

Cleans up and normalizes the data.

## Install

```sh
npm install tasklist
```

## Usage

```js
import {tasklist} from 'tasklist';

console.log(await tasklist());
/*
[
	{
		imageName: 'taskhostex.exe',
		pid: 1820,
		sessionName: 'Console',
		sessionNumber: 1,
		memUsage: 4415488
	},
	...
]
*/
```

## API

See the [`tasklist` docs](https://technet.microsoft.com/en-us/library/bb491010.aspx) for more.

### tasklist(options?)

Returns a `Promise<object[]>` that contains the normalized results of the command output.

Examples for `options` below will use this interface, but you can check `tasklistStream` below for usage of the stream interface.

### tasklistStream(options?)

Returns a `stream.Readable` that returns the resulting lines, normalized, one by one.

Options are the same as the Promise interface.

```js
import {tasklistStream} from 'tasklist';

tasklistStream({verbose: true}).pipe(process.stdout);
/*
{
	imageName: 'taskhostex.exe',
	pid: 1820,
	sessionName: 'Console',
	sessionNumber: 1,
	memUsage: 4415488,
	status: 'Running',
	username: 'SINDRESORHU3930\\sindre',
	cpuTime: 0,
	windowTitle: 'Task Host Window'
}
...
*/
```

#### options

Type: `object`

**Warning**
- The `system`, `username`, `password` options must be specified together.
- The `modules` and `services` options can't be specified if verbose is set to `true`.
- The `modules` and `services` options can't be specified at the same time.
- The `apps` option can't be specified with `modules` or `services`.
- When `system`, `username`, `password` options are specified, the filter option can't have `windowtitle` and `status` as the parameter.

##### verbose

Type: `boolean`\
Default: `false`

Return verbose results.

Without the `verbose` and `apps` option, `tasklist` returns tasks with the following properties:

- `imageName` (Type: `string`)
- `pid` (Type: `number`)
- `sessionName` (Type: `string`)
- `sessionNumber` (Type: `number`)
- `memUsage` in bytes (Type: `number`)

With the `verbose` option set to `true` but the `apps` option still set to `false`, it additionally returns the following properties:

- `status` (Type: `string`): One of `Running`, `Suspended`, `Not Responding`, or `Unknown`
- `username` (Type: `string`)
- `cpuTime` in seconds (Type: `number`)
- `windowTitle` (Type: `string`)

**Note:** It's not guaranteed that the `username` and `windowTitle` properties are returned with proper values. If they are *not available*, `'N/A'` may be returned on English systems. In contrast, `'Nicht zutreffend'` may be returned on German systems, for example.

**Verbose example:**

```js
import {tasklist} from 'tasklist';

console.log(await tasklist({verbose: true}));
/*
[
	{
		imageName: 'taskhostex.exe',
		pid: 1820,
		sessionName: 'Console',
		sessionNumber: 1,
		memUsage: 4415488,
		status: 'Running',
		username: 'SINDRESORHU3930\\sindre',
		cpuTime: 0,
		windowTitle: 'Task Host Window'
	},
	...
]
*/
```

**Warning:** Using the `verbose` option may have a considerable performance impact (See: [#6](https://github.com/sindresorhus/tasklist/issues/6)).

##### system

Type: `string`

Name or IP address of a remote computer (don't use backslashes). The default is the local computer.

##### username

Type: `string`\
Example: `'SINDRESORHU3930\\sindre'`

User specified by `User` or `Domain\User`. The default is the permissions of the current logged on user on the computer issuing the command.

##### password

Type: `string`

Password of the user account for the specified `username`.

##### filter

Type: `string[]`

Specify the types of processes to include or exclude. [More info.](https://technet.microsoft.com/en-us/library/bb491010.aspx)

##### apps

Type: `boolean`

Displays store apps.

Without the `verbose` option, the command returns the following data:

- `imageName` (Type: `string`)
- `pid` (Type: `number`)
- `memUsage` in bytes (Type: `number`)
- `packageName` (Type: `string`)

```js
import {tasklist} from 'tasklist';

console.log(await tasklist({apps: true}));
/*
[
	{
		imageName: 'SearchUI.exe (CortanaUI)',
		pid: 1820,
		memUsage: 4415488,
		packageName: 'Microsoft.Windows.Cortana'
	},
	...
]
*/
```

With the `verbose` option set to `true`, the command additionally returns the following data:

- `sessionName` (Type: `string`)
- `sessionNumber` (Type: `number`)
- `status` (Type: `string`): One of `Running`, `Suspended`, `Not Responding`, or `Unknown`
- `username` (Type: `string`)
- `cpuTime` in seconds (Type: `number`)
- `windowTitle` (Type: `string`)

**Note:** It's not guaranteed that the `username` and `windowTitle` properties are returned with proper values. If they are *not available*, `'N/A'` may be returned on English systems. In contrast, `'Nicht zutreffend'` may be returned on German systems, for example.

**Verbose example:**

```js
import {tasklist} from 'tasklist';

console.log(await tasklist({apps: true, verbose: true}));
/*
[
	{
		imageName: 'SearchUI.exe (CortanaUI)',
		pid: 1820,
		sessionName: 'Console',
		sessionNumber: 1,
		memUsage: 4415488,
		status: 'Running',
		username: 'SINDRESORHU3930\\sindre',
		cpuTime: 0,
		windowTitle: 'N/A',
		packageName: 'Microsoft.Windows.Cortana'
	},
	...
]
*/
```

##### modules

Type: `string`

List all tasks using the given DLL module name. If an empty string is given, it will list all tasks with the used DLL modules.

**Note:** You can't use the `verbose` option with this option set.

```js
import {tasklist} from 'tasklist';

console.log(await tasklist({modules: 'wmiutils.dll'}));
/*
[{
	imageName: 'chrome.exe',
	pid: 1820,
	modules: ['wmiutils.dll']
}, ...]
*/
```

##### services

Type: `boolean`

Displays services hosted in each process.

**Note:** You can't use the `verbose` option with this option set.

```js
import {tasklist} from 'tasklist';

console.log(await tasklist({services: true}));
/*
[{
	imageName: 'lsass.exe',
	pid: 856,
	services: ['KeyIso', 'SamSs', 'VaultSvc']
}, ...]
*/
```

## Related

- [taskkill](https://github.com/sindresorhus/taskkill) - Wrapper for the Windows `taskkill` command

## Maintainers

- [Sindre Sorhus](https://sindresorhus.com)
- [Mark Tiedemann](https://marksweb.site)

---
_Source: https://npm.io/package/tasklist · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
