1. License
“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”
Free for paid and closed products; keep the MIT notice with the package files.
github.com/sindresorhus/execa/blob/main/license3. Used by agents' projects
Dependency in 46 public GitHub projects set up for AI coding agents that we scanned (0.7%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
From the package registry and GitHub, checked daily; card checked Nov 11, 2026. Tap a verdict to see its source.How we checkedReport an error
What execa does
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.
What people build with it
Build and deploy scripts
A release script in JavaScript runs the build, reads the current git branch and starts the deploy, one step after another.
Process a file a user uploaded
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.
Stop a command that hangs
A tool your AI agent or job queue starts sometimes never ends; give it a time limit and report a clear timeout.
Show clear errors when a step fails
When a command fails, your log shows the command, its exit code and what it printed, instead of a bare crash.
Watch warnings while a build runs
Read a long command's output line by line and react to each warning as it appears, not only at the end.
Run project tools without npx
A script calls a tool installed in the project, such as a linter, without a global install.
execa popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How execa is used
- 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%).
By coding agent
Often used with
More about execa
Funding
- 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
Alternatives
execa This page
Pick zx when you want a shell-script feel with many helpers built in (fetch, prompts, globbing, spinner); it runs commands through a shell.
Pick tinyexec when you only need to run a command and read its output, and want a very small package.
Pick cross-spawn when you only need Node's own spawn() to behave the same on Windows, with no promise layer.
Get started
Tell your AI assistant
“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.”
Add execa to your Node.js project (version 10 needs Node.js 22 or newer).
npm install execaImport it and run a command with the template syntax; spaces split the command into the program and its arguments.
import {execa} from 'execa'; const {stdout} = await execa`npm run build`; // Print command's output console.log(stdout);From github.com/sindresorhus/execa/blob/main/docs/escaping.md
Mistakes to avoid
execaCommand() and execaCommandSync() were removed in execa 10.
Since execa 10 the subprocess is a plain promise; Node's ChildProcess methods moved to subprocess.nodeChildProcess.
With the shell on, execa stops escaping arguments, so a name like 'a.png; rm -rf ~' runs a second command.
No shell runs, so $VAR, *, | and && are passed as plain text.
execa 10 declares engines node >=22.
Questions
Is it safe to put a user's file name into a command?
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.
Does it work in the browser?
No. It is built on Node's child_process module, so it runs in Node.js on a server or your computer.
Where did execaCommand() go?
Version 10 removed execaCommand() and execaCommandSync(). Use the template syntax, or parseCommandString() for a command held in one string.
How do I know why a command failed?
The error carries the exit code and flags such as timedOut, isCanceled and isMaxBuffer.