MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / runJson

Function runJson

packages/simdeck-test/src/index.ts:880–896  ·  view source on GitHub ↗
(
  command: string,
  args: string[],
  options: { cwd?: string } = {},
)

Source from the content-addressed store, hash-verified

878}
879
880function runJson<T>(
881 command: string,
882 args: string[],
883 options: { cwd?: string } = {},
884): T {
885 const result = spawnSync(command, args, {
886 cwd: options.cwd,
887 encoding: "utf8",
888 maxBuffer: 1024 * 1024,
889 });
890 if (result.status !== 0) {
891 throw new Error(
892 result.stderr.trim() || `${command} ${args.join(" ")} failed`,
893 );
894 }
895 return JSON.parse(result.stdout) as T;
896}
897
898function requestOk(
899 endpoint: string,

Callers 1

connectFunction · 0.70

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected