{"id":22788873,"url":"https://github.com/rjoydip/win_tasklist","last_synced_at":"2025-03-30T16:23:12.404Z","repository":{"id":114445997,"uuid":"558506106","full_name":"rjoydip/win_tasklist","owner":"rjoydip","description":"Wrapper for the Windows tasklist command.","archived":false,"fork":false,"pushed_at":"2022-10-27T17:24:50.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T18:02:23.981Z","etag":null,"topics":["deno","task","task-list","windows"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rjoydip.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-27T17:24:40.000Z","updated_at":"2023-03-17T13:23:35.000Z","dependencies_parsed_at":"2023-06-08T04:00:27.023Z","dependency_job_id":null,"html_url":"https://github.com/rjoydip/win_tasklist","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjoydip%2Fwin_tasklist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjoydip%2Fwin_tasklist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjoydip%2Fwin_tasklist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjoydip%2Fwin_tasklist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rjoydip","download_url":"https://codeload.github.com/rjoydip/win_tasklist/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246344204,"owners_count":20762160,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deno","task","task-list","windows"],"created_at":"2024-12-12T01:37:54.205Z","updated_at":"2025-03-30T16:23:12.385Z","avatar_url":"https://github.com/rjoydip.png","language":"TypeScript","readme":"# win_tasklist ![Build status](https://github.com/rjoydip/win_tasklist/workflows/ci/badge.svg)\n\n\u003e 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.\n\nCleans up and normalizes the data.\n\n**Port of [tasklist](https://github.com/sindresorhus/tasklist)**\n\n\u003e Note: **Test is incomplete (Welcome for PR)** due to \"Bad resourse ID\" \u003chttps://github.com/denoland/deno/issues/4830\u003e \u003chttps://github.com/denoland/deno/issues/2703\u003e \u003chttps://github.com/denoland/deno/issues/2692\u003e\n\n## Install\n\n```sh\ndeno install --allow-run -f --name tasklist \"deno.land/x/win_tasklist/cli.ts\"\n```\n\n## Usage\n\n```ts\nimport { tasklist } from \"deno.land/x/win_tasklist/mod.ts\";\n\n(async () =\u003e {\n  console.log(await tasklist());\n  /*\n [\n  {\n   imageName: 'taskhostex.exe',\n   pid: 1820,\n   sessionName: 'Console',\n   sessionNumber: 1,\n   memUsage: 4415488\n  },\n  …\n ]\n */\n})();\n```\n\n## API\n\nSee the [`tasklist` docs](https://technet.microsoft.com/en-us/library/bb491010.aspx) for more.\n\n### tasklist(options?)\n\nReturns a `Promise\u003cobject[]\u003e` that contains the normalized results of the command output.\n\nExamples for `options` below will use this interface, but you can check `tasklist.stream` below for usage of the stream interface.\n\n### tasklist.stream(options?)\n\nReturns a `stream.Readable` that returns the resulting lines, normalized, one-by-one.\n\nOptions are the same as the Promise interface.\n\n**Example using stream interface**\n\n```ts\nimport { tasklist } from \"deno.land/x/win_tasklist/mod.ts\";\n\ntasklist.stream({ verbose: true }).pipe(process.stdout);\n/*\n{\n    imageName: 'taskhostex.exe',\n    pid: 1820,\n    sessionName: 'Console',\n    sessionNumber: 1,\n    memUsage: 4415488,\n    status: 'Running',\n    username: 'SINDRESORHU3930\\\\sindre'\n    cpuTime: 0,\n    windowTitle: 'Task Host Window'\n}\n…\n*/\n```\n\n#### options\n\nType: `object`\n\n**Warning**\nThe `system`, `username`, `password` options must be specified together.\nThe `modules` and `services` options can't be specified if verbose is set to `true`.\nThe `modules` and `services` options can't be specified at the same time.\nWhen `system`, `username`, `password` options are specified, the filter option can't have `windowtitle` and `status` as the parameter.\n\n##### verbose\n\nType: `boolean`\\\nDefault: `false`\n\nReturn verbose results.\n\nWithout the `verbose` and `apps` option, `tasklist` returns tasks with the following properties:\n\n- `imageName` (Type: `string`)\n- `pid` (Type: `number`)\n- `sessionName` (Type: `string`)\n- `sessionNumber` (Type: `number`)\n- `memUsage` in bytes (Type: `number`)\n\nWith the `verbose` option set to `true` but the `apps` option still set to `false`, it additionally returns the following properties:\n\n- `status` (Type: `string`): One of `Running`, `Suspended`, `Not Responding`, or `Unknown`\n- `username` (Type: `string`)\n- `cpuTime` in seconds (Type: `number`)\n- `windowTitle` (Type: `string`)\n\n**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.\n\n**Verbose example:**\n\n```ts\nimport { tasklist } from \"deno.land/x/win_tasklist/mod.ts\";\n\n(async () =\u003e {\n  console.log(await tasklist({ verbose: true }));\n  /*\n [\n  {\n   imageName: 'taskhostex.exe',\n         pid: 1820,\n         sessionName: 'Console',\n         sessionNumber: 1,\n         memUsage: 4415488,\n         status: 'Running',\n         username: 'SINDRESORHU3930\\\\sindre'\n         cpuTime: 0,\n         windowTitle: 'Task Host Window'\n  },\n  …\n ]\n */\n})();\n```\n\n**Warning:** Using the `verbose` option may have a considerable performance impact (See: [#6](https://github.com/sindresorhus/tasklist/issues/6)).\n\n##### system\n\nType: `string`\n\nName or IP address of a remote computer (don't use backslashes). The default is the local computer.\n\n##### username\n\nType: `string`\\\nExample: `'SINDRESORHU3930\\\\sindre'`\n\nUser specified by `User` or `Domain\\User`. The default is the permissions of the current logged on user on the computer issuing the command.\n\n##### password\n\nType: `string`\n\nPassword of the user account for the specified `username`.\n\n##### filter\n\nType: `string[]`\n\nSpecify the types of processes to include or exclude. [More info.](https://technet.microsoft.com/en-us/library/bb491010.aspx)\n\n##### apps\n\nType: `boolean`\n\nDisplays store apps.\nWithout the `verbose` option, the command returns the following data:\n\n- `imageName` (Type: `string`)\n- `pid` (Type: `number`)\n- `memUsage` in bytes (Type: `number`)\n- `packageName` (Type: `string`)\n\n**Example:**\n\n```ts\nimport { tasklist } from \"deno.land/x/win_tasklist/mod.ts\";\n\n(async () =\u003e {\n  console.log(await tasklist({ apps: true }));\n  /*\n [\n  {\n   imageName: 'SearchUI.exe (CortanaUI)',\n         pid: 1820,\n         memUsage: 4415488,\n         packageName: 'Microsoft.Windows.Cortana'\n  },\n  …\n ]\n */\n})();\n```\n\nWith the `verbose` option set to `true`, the command additionally returns the following data:\n\n- `sessionName` (Type: `string`)\n- `sessionNumber` (Type: `number`)\n- `status` (Type: `string`): One of `Running`, `Suspended`, `Not Responding`, or `Unknown`\n- `username` (Type: `string`)\n- `cpuTime` in seconds (Type: `number`)\n- `windowTitle` (Type: `string`)\n\n**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.\n\n**Verbose example:**\n\n```ts\nimport { tasklist } from \"deno.land/x/win_tasklist/mod.ts\";\n\n(async () =\u003e {\n  console.log(await tasklist({ apps: true, verbose: true }));\n  /*\n [\n  {\n   imageName: 'SearchUI.exe (CortanaUI)',\n         pid: 1820,\n         sessionName: 'Console',\n         sessionNumber: 1,\n         memUsage: 4415488,\n         status: 'Running',\n         username: 'SINDRESORHU3930\\\\sindre'\n         cpuTime: 0,\n         windowTitle: 'N/A',\n         packageName: 'Microsoft.Windows.Cortana'\n  },\n  …\n ]\n */\n})();\n```\n\n##### modules\n\nType: `string`\n\nList all tasks using the given DLL module name. If an empty string is given, it will list all tasks with the used DLL modules.\n\n**Note:** You can't use the `verbose` option with this option set.\n\n**Example:**\n\n```ts\nimport { tasklist } from \"deno.land/x/win_tasklist/mod.ts\";\n\n(async () =\u003e {\n  console.log(await tasklist({ modules: \"wmiutils.dll\" }));\n  /*\n [{\n  imageName: 'chrome.exe',\n        pid: 1820,\n        modules: ['wmiutils.dll']\n }, …]\n */\n})();\n```\n\n##### services\n\nType: `boolean`\n\nDisplays services hosted in each process.\n**Note:** You can't use the `verbose` option with this option set.\n\n**Example:**\n\n```ts\nimport { tasklist } from \"deno.land/x/win_tasklist/mod.ts\";\n\n(async () =\u003e {\n  console.log(await tasklist({ services: true }));\n  /*\n [{\n  imageName: 'lsass.exe',\n        pid: 856,\n        services: ['KeyIso', 'SamSs', 'VaultSvc']\n }, …]\n */\n})();\n```\n\n## Inspired\n\n- [tasklist](https://github.com/sindresorhus/tasklist) - Wrapper for the Windows `tasklist` command.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frjoydip%2Fwin_tasklist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frjoydip%2Fwin_tasklist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frjoydip%2Fwin_tasklist/lists"}