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/taskkill/index.js
'use strict';
const arrify = require('arrify');
const execa = require('execa');

module.exports = async (input, options = {}) => {
	input = arrify(input);

	if (process.platform !== 'win32') {
		throw new Error('Windows only');
	}

	if (input.length === 0) {
		throw new Error('PID or image name required');
	}

	const args = [];

	if (options.system && options.username && options.password) {
		args.push('/s', options.system, '/u', options.username, '/p', options.password);
	}

	if (options.filter) {
		args.push('/fi', options.filter);
	}

	if (options.force) {
		args.push('/f');
	}

	if (options.tree) {
		args.push('/t');
	}

	for (const x of input) {
		args.push(typeof x === 'number' ? '/pid' : '/im', x);
	}

	return execa('taskkill', args);
};