From e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d Mon Sep 17 00:00:00 2001 From: Piotr Russ Date: Mon, 16 Nov 2020 00:10:28 +0100 Subject: api, login, auth --- node_modules/npm-run-all/lib/spawn-win32.js | 50 +++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 node_modules/npm-run-all/lib/spawn-win32.js (limited to 'node_modules/npm-run-all/lib/spawn-win32.js') diff --git a/node_modules/npm-run-all/lib/spawn-win32.js b/node_modules/npm-run-all/lib/spawn-win32.js new file mode 100644 index 0000000..3743a1d --- /dev/null +++ b/node_modules/npm-run-all/lib/spawn-win32.js @@ -0,0 +1,50 @@ +/** + * @module spawn-win32 + * @author Toru Nagashima + * @copyright 2015 Toru Nagashima. All rights reserved. + * See LICENSE file in root directory for full license. + */ +"use strict" + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const crossSpawn = require("cross-spawn") + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +/** + * Kills the new process and its sub processes forcibly. + * @this ChildProcess + * @returns {void} + */ +function kill() { + crossSpawn("taskkill", ["/F", "/T", "/PID", this.pid]) +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +/** + * Launches a new process with the given command. + * This is almost same as `child_process.spawn`. + * + * This returns a `ChildProcess` instance. + * `kill` method of the instance kills the new process and its sub processes forcibly. + * + * @param {string} command - The command to run. + * @param {string[]} args - List of string arguments. + * @param {object} options - Options. + * @returns {ChildProcess} A ChildProcess instance of new process. + * @private + */ +module.exports = function spawn(command, args, options) { + const child = crossSpawn(command, args, options) + child.kill = kill + + return child +} -- cgit v1.2.3