diff options
author | 2020-11-18 23:26:45 +0100 | |
---|---|---|
committer | 2020-11-18 23:26:45 +0100 | |
commit | 81ddf9b700bc48a1f8e472209f080f9c1d9a9b09 (patch) | |
tree | 8b959d50c5a614cbf9fcb346ed556140374d4b6d /node_modules/pidtree/lib/wmic.js | |
parent | 1870f3fdf43707a15fda0f609a021f516f45eb63 (diff) | |
download | website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.gz website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.tar.bz2 website_creator-81ddf9b700bc48a1f8e472209f080f9c1d9a9b09.zip |
rm node_modules
Diffstat (limited to 'node_modules/pidtree/lib/wmic.js')
-rw-r--r-- | node_modules/pidtree/lib/wmic.js | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/node_modules/pidtree/lib/wmic.js b/node_modules/pidtree/lib/wmic.js deleted file mode 100644 index 0361728..0000000 --- a/node_modules/pidtree/lib/wmic.js +++ /dev/null @@ -1,49 +0,0 @@ -'use strict'; - -var os = require('os'); -var bin = require('./bin'); - -/** - * Gets the list of all the pids of the system through the wmic command. - * @param {Function} callback(err, list) - */ -function wmic(callback) { - var args = ['PROCESS', 'get', 'ParentProcessId,ProcessId']; - var options = {windowsHide: true, windowsVerbatimArguments: true}; - bin('wmic', args, options, function(err, stdout, code) { - if (err) { - callback(err); - return; - } - - if (code !== 0) { - callback(new Error('pidtree wmic command exited with code ' + code)); - return; - } - - // Example of stdout - // - // ParentProcessId ProcessId - // 0 777 - - try { - stdout = stdout.split(os.EOL); - - var list = []; - for (var i = 1; i < stdout.length; i++) { - stdout[i] = stdout[i].trim(); - if (!stdout[i]) continue; - stdout[i] = stdout[i].split(/\s+/); - stdout[i][0] = parseInt(stdout[i][0], 10); // PPID - stdout[i][1] = parseInt(stdout[i][1], 10); // PID - list.push(stdout[i]); - } - - callback(null, list); - } catch (error) { - callback(error); - } - }); -} - -module.exports = wmic; |