INNER CODE UNIT · TypeScript

exec

cyanheads/pubmed-mcp-server · scripts/build.ts:51

async function exec(
  cmd: string[],
  label: string,
): Promise<{ ok: boolean; stdout: string; stderr: string; ms: number }> {
  const start = performance.now();
  const [bin, ...args] = cmd;

  const { stdout, stderr, exitCode } = await new Promise<{
    stdout: string;
    stderr: string;
    exitCode: number;
  }>((resolve) => {
    execFile(bin ?? '', args, { cwd: ROOT_DIR }, (error, stdout, stderr) => {
      resolve({
        stdout: (stdout ?? '').trim(),
        stderr: (stderr ?? '').trim(),
        exitCode: error ? Number(error.code) || 1 : 0,
      });

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…