1
>
/*---------------------------------------------------------------------------------------------
ps.ts
2
>
* Copyright (c) Microsoft Corporation. All rights reserved.
3
>
* Licensed under the MIT License. See License.txt in the project root for license information.
4
>
*--------------------------------------------------------------------------------------------*/
5
>
6
>
import { exec } from 'child_process';
7
>
import { totalmem } from 'os';
8
>
import { FileAccess } from '../common/network.js';
9
>
import { ProcessItem } from '../common/processes.js';
10
>
import { isWindows } from '../common/platform.js';
11
>
12
>
export const JS_FILENAME_PATTERN = /[a-zA-Z-]+\.js\b/g;
13
>
14
>
export function listProcesses(rootPid: number): Promise<ProcessItem> {
15
return new Promise((resolve, reject) => {
16
let rootItem: ProcessItem | undefined;