{
 "kind": "tool",
 "slug": "execa",
 "path": "tools/execa/",
 "name": "execa",
 "maker": null,
 "density": "full",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Utilities",
   "tools/utilities/"
  ]
 ],
 "lead": "Run other programs from Node.js code.",
 "chips": [
  {
   "label": "Utilities",
   "path": "tools/utilities/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install execa"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/sindresorhus/execa"
  },
  {
   "label": "Website",
   "href": "https://github.com/sindresorhus/execa#readme"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "MIT",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": "to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software",
   "note": "Free for paid and closed products; keep the MIT notice with the package files.",
   "src": "https://github.com/sindresorhus/execa/blob/main/license"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 18, 2026",
   "note": "Latest GitHub release Oct 23, 2026. ",
   "src": "https://github.com/sindresorhus/execa"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "46 projects",
   "status": "info",
   "sub": "#30 of 408 in its category",
   "note": "Dependency in 46 public GitHub projects set up for AI coding agents that we scanned (0.7%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Install only",
   "status": "info",
   "sub": null,
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily; card checked Nov 11, 2026.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What execa does",
   "parts": [
    {
     "t": "prose",
     "text": "execa is a free JavaScript package that lets a Node.js script or server start other programs, such as git, ffmpeg or a build command, and read what they print. Each piece of text, like a file name a user typed, reaches the program as one separate value, so it cannot sneak in a second command. It runs only on a server or your own computer, not in a web page."
    },
    {
     "t": "h3",
     "text": "What people build with it"
    },
    {
     "t": "uses",
     "items": [
      {
       "title": "Build and deploy scripts",
       "text": "A release script in JavaScript runs the build, reads the current git branch and starts the deploy, one step after another.",
       "idea": false
      },
      {
       "title": "Process a file a user uploaded",
       "text": "Your server calls an image or video tool on a file whose name came from a user; the name stays one value even if it holds spaces or a semicolon.",
       "idea": false
      },
      {
       "title": "Stop a command that hangs",
       "text": "A tool your AI agent or job queue starts sometimes never ends; give it a time limit and report a clear timeout.",
       "idea": false
      },
      {
       "title": "Show clear errors when a step fails",
       "text": "When a command fails, your log shows the command, its exit code and what it printed, instead of a bare crash.",
       "idea": false
      },
      {
       "title": "Watch warnings while a build runs",
       "text": "Read a long command's output line by line and react to each warning as it appears, not only at the end.",
       "idea": false
      },
      {
       "title": "Run project tools without npx",
       "text": "A script calls a tool installed in the project, such as a linter, without a global install.",
       "idea": false
      }
     ]
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "execa popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "71",
       "of": "/ 100",
       "l": "Gid Score, #344 overall"
      },
      {
       "n": "245M",
       "l": "downloads a week, npm"
      },
      {
       "n": "7,666",
       "l": "GitHub stars"
      },
      {
       "n": "46",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How execa is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "execa is a dependency in 46 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (0.9% of the 4,867 JavaScript/TypeScript ones), #30 of 408 in utilities.",
      "Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 144; those are left out of every share on this page.",
      "Projects that use it most often also use tsx (78.3%), chalk (69.6%), Zod (78.3%).",
      "It is more common in projects set up for Kiro (5.0%) than for GitHub Copilot (0.7%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "38 projects, 1.2%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "21 projects, 0.7%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "19 projects, 0.8%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "7 projects, 5.0%",
       "v": "Kiro",
       "path": "agents/kiro/"
      },
      {
       "l": "6 projects, 1.8%",
       "v": "OpenClaw",
       "path": "agents/openclaw/"
      },
      {
       "l": "6 projects, 1.3%",
       "v": "Gemini CLI",
       "path": "agents/gemini-cli/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 78.3% of its projects",
       "v": "tsx",
       "path": "tools/tsx/"
      },
      {
       "l": "In 69.6% of its projects",
       "v": "chalk",
       "path": "tools/chalk/"
      },
      {
       "l": "In 78.3% of its projects",
       "v": "Zod",
       "path": "tools/zod/"
      },
      {
       "l": "In 56.5% of its projects",
       "v": "Anthropic SDK",
       "path": "tools/anthropic-ai/"
      },
      {
       "l": "In 54.3% of its projects",
       "v": "Commander",
       "path": "tools/commander/"
      },
      {
       "l": "In 54.3% of its projects",
       "v": "dotenv",
       "path": "tools/dotenv/"
      },
      {
       "l": "In 43.5% of its projects",
       "v": "Biome",
       "path": "tools/biomejs/"
      },
      {
       "l": "In 43.5% of its projects",
       "v": "Marked",
       "path": "tools/marked/"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "usage",
   "h2": "More about execa",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Funding",
       "path": "tools/funding/",
       "items": [
        "GitHub Sponsors: https://github.com/sindresorhus",
        "Open Collective: https://opencollective.com/sindresorhus",
        "Buy Me a Coffee: https://buymeacoffee.com/sindresorhus",
        "Own page: https://sindresorhus.com/donate",
        "Own page: https://github.com/sindresorhus/execa?sponsor=1",
        "186 GitHub sponsors"
       ]
      },
      {
       "title": "More in Utilities",
       "path": "tools/utilities/",
       "items": [
        {
         "text": "clsx",
         "path": "tools/clsx/"
        },
        {
         "text": "date-fns",
         "path": "tools/date-fns/"
        },
        {
         "text": "PyYAML",
         "path": "tools/pyyaml/"
        },
        {
         "text": "uuid",
         "path": "tools/uuid/"
        },
        {
         "text": "yaml",
         "path": "tools/yaml/"
        },
        {
         "text": "js-yaml",
         "path": "tools/js-yaml/"
        },
        {
         "text": "glob",
         "path": "tools/glob/"
        },
        {
         "text": "Lodash",
         "path": "tools/lodash/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "execa",
       "me": true,
       "facts": [
        "MIT",
        "Gid 71",
        "245M/wk"
       ]
      },
      {
       "name": "zx",
       "why": "Pick zx when you want a shell-script feel with many helpers built in (fetch, prompts, globbing, spinner); it runs commands through a shell.",
       "path": "tools/zx/",
       "facts": []
      },
      {
       "name": "tinyexec",
       "why": "Pick tinyexec when you only need to run a command and read its output, and want a very small package.",
       "path": "tools/tinyexec/",
       "facts": []
      },
      {
       "name": "cross-spawn",
       "why": "Pick cross-spawn when you only need Node's own spawn() to behave the same on Windows, with no promise layer.",
       "path": "tools/cross-spawn/",
       "facts": []
      }
     ],
     "more": "Compare execa with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "prompt",
     "text": "Use the npm package execa (pin execa@10.2.1, Node.js 22+) to run the external command from my server code, pass user-supplied values only as ${} or array arguments, never set shell true, add a timeout, and catch ExecaError."
    },
    {
     "t": "steps",
     "items": [
      {
       "text": "Add execa to your Node.js project (version 10 needs Node.js 22 or newer).",
       "code": "npm install execa",
       "src": "https://github.com/sindresorhus/execa/blob/main/readme.md"
      },
      {
       "text": "Import it and run a command with the template syntax; spaces split the command into the program and its arguments.",
       "code": "import {execa} from 'execa';\n\nconst {stdout} = await execa`npm run build`;\n// Print command's output\nconsole.log(stdout);\n",
       "src": "https://github.com/sindresorhus/execa/blob/main/docs/escaping.md"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Mistakes to avoid"
    },
    {
     "t": "mistakes",
     "items": [
      {
       "dont": "await execaCommand('npm run build')",
       "fix": "await execa`npm run build` (or execa`${parseCommandString(commandString)}` for a dynamic string)",
       "why": "execaCommand() and execaCommandSync() were removed in execa 10."
      },
      {
       "dont": "subprocess.on('spawn', onSpawn)",
       "fix": "subprocess.nodeChildProcess.on('spawn', onSpawn)",
       "why": "Since execa 10 the subprocess is a plain promise; Node's ChildProcess methods moved to subprocess.nodeChildProcess."
      },
      {
       "dont": "await execa({shell: true})`convert ${userFileName} out.jpg`",
       "fix": "Leave shell off and pass the value with ${} or in the arguments array",
       "why": "With the shell on, execa stops escaping arguments, so a name like 'a.png; rm -rf ~' runs a second command."
      },
      {
       "dont": "execa`echo $HOME` or execa`ls *.txt` expecting the shell to expand them",
       "fix": "Read process.env.HOME or list files in JavaScript, then pass the values as arguments",
       "why": "No shell runs, so $VAR, *, | and && are passed as plain text."
      },
      {
       "dont": "npm install execa on Node.js 18 or 20",
       "fix": "Use Node.js 22+, or pin execa@9 on older Node.js",
       "why": "execa 10 declares engines node >=22."
      }
     ]
    }
   ]
  },
  {
   "id": "faq",
   "nav": "Questions",
   "h2": "Questions",
   "parts": [
    {
     "t": "faq",
     "items": [
      {
       "q": "Is it safe to put a user's file name into a command?",
       "a": "Yes, as long as you pass it with ${} or in the arguments array and do not switch the shell on; it then reaches the program as one argument.",
       "evidence": {
        "url": "https://github.com/sindresorhus/execa/blob/main/docs/escaping.md",
        "quote": "They can contain any character, including spaces, tabs and newlines."
       }
      },
      {
       "q": "Does it work in the browser?",
       "a": "No. It is built on Node's child_process module, so it runs in Node.js on a server or your computer.",
       "evidence": {
        "url": "https://github.com/sindresorhus/execa/blob/main/readme.md",
        "quote": "Built on top of the child_process core module."
       }
      },
      {
       "q": "Where did execaCommand() go?",
       "a": "Version 10 removed execaCommand() and execaCommandSync(). Use the template syntax, or parseCommandString() for a command held in one string.",
       "evidence": {
        "url": "https://github.com/sindresorhus/execa/releases/tag/v10.0.0",
        "quote": "Removed execaCommand() and execaCommandSync()"
       }
      },
      {
       "q": "How do I know why a command failed?",
       "a": "The error carries the exit code and flags such as timedOut, isCanceled and isMaxBuffer.",
       "evidence": {
        "url": "https://github.com/sindresorhus/execa/blob/main/docs/errors.md",
        "quote": "The subprocess can fail for other reasons. Some of them can be detected using a specific boolean property"
       }
      }
     ]
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm execa"
  ],
  [
   "Category",
   "Utilities"
  ],
  [
   "License",
   "MIT"
  ],
  [
   "Gid Score",
   "70.9"
  ],
  [
   "Rank in category",
   "#30 of 408"
  ],
  [
   "GitHub",
   "sindresorhus/execa"
  ],
  [
   "Last change",
   "Nov 18, 2026"
  ]
 ],
 "good": [
  "Version 10 needs Node.js 22 or newer. On older Node.js, stay on version 9.",
  "It does not use a shell unless you ask for one. Pipes, redirects and wildcards like *.txt then have no special meaning.",
  "If you switch the shell on, the safety goes away; your code must quote every value itself."
 ],
 "checked_line": "Read by AgentGid from 12 official pages, card checked Nov 11, 2026; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/sindresorhus.png"
}