HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/shop.komma.nl/node_modules/process-exists/index.js
'use strict';
const psList = require('ps-list');

const fn = (proc, x) => {
	if (typeof proc === 'string') {
		return x.name === proc;
	}

	return x.pid === proc;
};

module.exports = proc => psList().then(list => list.some(x => fn(proc, x)));
module.exports.all = procs => psList().then(list => new Map(procs.map(x => [x, list.some(y => fn(x, y))])));
module.exports.filterExists = procs => psList().then(list => procs.filter(x => list.some(y => fn(x, y))));