MCPcopy
hub / github.com/showdownjs/showdown / spawnCLI

Function spawnCLI

test/node/testsuite.cli.js:22–34  ·  view source on GitHub ↗

* Spawns a CLI process synchrously * @param {string|null} command * @param {string[]} args * @param {{}} [options] * @returns {{output: *, stdout: string, stderr: string, status: number}}

(command, args, options)

Source from the content-addressed store, hash-verified

20 * @returns {{output: *, stdout: string, stderr: string, status: number}}
21 */
22function spawnCLI (command, args, options) {
23 'use strict';
24 var nargs = ['src/cli/cli.js'];
25 if (command) { nargs.push(command);}
26 args = nargs.concat(args);
27 var otp = spawnSync('node', args, options),
28 stdout = otp.stdout.toString(),
29 stderr = otp.stderr.toString(),
30 output = otp.output[0],
31 status = otp.status;
32
33 return {stdout: stdout, stderr: stderr, output: output, status: status};
34}
35
36describe('showdown cli', function () {
37 'use strict';

Callers 1

testsuite.cli.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…