{"c8":{"exclude":["**/fixtures/**","**/test.js","**/test/**"],"reporter":["text","lcov"]},"xo":[{"rules":{"no-shadow":"off","regexp/strict":"off","@stylistic/max-len":"off","unicorn/no-array-sort":"off","unicorn/no-empty-file":"off","require-unicode-regexp":"off","unicorn/max-nested-calls":"off","unicorn/no-array-reverse":"off","unicorn/prefer-string-raw":"off","unicorn/no-array-from-fill":"off","node-test/require-assertion":"off","@typescript-eslint/ban-types":"off","jsdoc/require-asterisk-prefix":"off","node-test/no-conditional-tests":"off","node-test/no-import-test-files":"off","node-test/no-useless-assertion":"off","unicorn/prefer-minimal-ternary":"off","@typescript-eslint/await-thenable":"off","@typescript-eslint/no-unsafe-call":"off","node-test/no-process-env-mutation":"off","unicorn/require-module-specifiers":"off","unicorn/require-array-sort-compare":"off","node-test/prefer-test-context-assert":"off","unicorn/no-useless-template-literals":"off","unicorn/prefer-number-is-safe-integer":"off","@typescript-eslint/no-restricted-types":"off","@typescript-eslint/no-empty-object-type":"off","@typescript-eslint/no-unsafe-assignment":"off","@typescript-eslint/no-unsafe-member-access":"off","unicorn/no-computed-property-existence-check":"off","@typescript-eslint/no-unnecessary-type-assertion":"off"}},{"files":["**/*.md"],"rules":{"markdown/fenced-code-language":"off"}}],"_id":"execa@10.1.0","bugs":{"url":"https://github.com/sindresorhus/execa/issues"},"dist":{"shasum":"c35bdc00c07dc5b40df0831920594a54fb6ccbdf","tarball":"http://registry-npm.ywwl.com/execa/download/execa-10.1.0.tgz","fileCount":146,"integrity":"sha512-5HT/600HqXEtmkb9mK/PkTWw+bQSCzPnWiZ4/87wD3Hi0wFzCapOuNT9p4M08PDd+KLHdHvFhKjOWmNx/npRNQ==","signatures":[{"sig":"MEUCIQDy6qQbsXtq+ZEB0JfY09JpmzHp2v0XfSuE4+EVemo6gwIgFuHqhggwoJKq7L8mv+aUmi1OUGHlwxgW0pnG2VUzDKg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIADO9vG7sbdmUpdqNUACYFgoqR3Vdf4eoFcrVhuYtULfAiAC0Q3P3gOgV2sdDPAG+DrLPvyj3+h8y/uMoENHnhRMug=="}],"unpackedSize":392299,"size":105922,"noattachment":false,"key":"/execa/-/execa-10.1.0.tgz"},"name":"execa","type":"module","types":"./index.d.ts","author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"engines":{"node":">=22"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sindresorhus/execa?sponsor=1","gitHead":"63ddae6aeb6934da06fdb3754647791e58cd87c3","license":"MIT","scripts":{"lint":"xo","test":"npm run lint && npm run unit && npm run type","type":"tsd && tsc","unit":"c8 --merge-async node --test --test-concurrency=1 --test-timeout=240000 \"test/!(fixtures|helpers)/*.js\""},"version":"10.1.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"homepage":"https://github.com/sindresorhus/execa#readme","keywords":["exec","child","process","subprocess","execute","fork","execfile","spawn","file","shell","bin","binary","binaries","npm","path","local","zx"],"repository":{"url":"git+https://github.com/sindresorhus/execa.git","type":"git"},"_npmVersion":"12.0.1","description":"Process execution for humans","directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"},{"name":"ehmicky","email":"ehmicky@gmail.com"}],"sideEffects":false,"_nodeVersion":"22.23.3","dependencies":{"figures":"^6.1.0","is-stream":"^4.0.1","pretty-ms":"^9.3.1","get-stream":"^9.0.1","signal-exit":"^4.1.0","yoctocolors":"^2.2.0","is-plain-obj":"^4.1.0","npm-run-path":"^6.0.0","human-signals":"^8.0.1","which-command":"^0.1.0","strip-final-newline":"^4.0.0","@sindresorhus/merge-streams":"^4.0.0"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^12.0.0","xo":"^5.0.1","tsd":"^0.33.0","get-node":"^15.0.4","is-in-ci":"^2.0.0","path-key":"^4.0.0","tempfile":"^6.0.1","is-running":"^2.1.0","typescript":"^6.0.3","@types/node":"^26.6.2","path-exists":"^5.0.0","log-process-errors":"^12.0.1"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/execa_10.1.0_1791302704034_0.30588318145252136"},"readme":"<picture>\n\t<source media=\"(prefers-color-scheme: dark)\" srcset=\"media/logo_dark.svg\">\n\t<img alt=\"execa logo\" src=\"media/logo.svg\" width=\"400\">\n</picture>\n<br>\n\n[![Coverage Status](https://codecov.io/gh/sindresorhus/execa/branch/main/graph/badge.svg)](https://app.codecov.io/gh/sindresorhus/execa)\n\n> Process execution for humans\n\n<br>\n\n---\n\n<div align=\"center\">\n\t<p>\n\t\t<p>\n\t\t\t<sup>\n\t\t\t\t<a href=\"https://github.com/sponsors/sindresorhus\">Sindre's open source work is supported by the community</a>\n\t\t\t</sup>\n\t\t</p>\n\t\t<sup>Special thanks to:</sup>\n\t\t<br>\n\t\t<br>\n\t\t<br>\n\t\t<a href=\"https://coderabbit.ai?utm_source=sindre&utm_medium=execa\">\n\t\t\t<img width=\"300\" src=\"https://sindresorhus.com/assets/thanks/coderabbit-logo.png\" alt=\"CodeRabbit logo\">\n\t\t</a>\n\t\t<br>\n\t\t<br>\n\t\t<br>\n\t\t<a href=\"https://kruu.com\">\n\t\t\t<picture>\n\t\t\t\t<source srcset=\"https://sindresorhus.com/assets/thanks/kruu-logo-dark.svg?y\" media=\"(prefers-color-scheme: dark)\" width=\"260\">\n\t\t\t\t<source srcset=\"https://sindresorhus.com/assets/thanks/kruu-logo-light.svg?y\" media=\"(prefers-color-scheme: light)\" width=\"260\">\n\t\t\t\t<img src=\"https://sindresorhus.com/assets/thanks/kruu-logo-light.svg?y\" width=\"260\"alt=\"KRUU logo\">\n\t\t\t</picture>\n\t\t</a>\n\t\t<br>\n\t\t<br>\n\t\t<br>\n\t\t<a href=\"https://depot.dev?utm_source=github&utm_medium=sindresorhus\">\n\t\t\t<div>\n\t\t\t\t<picture>\n\t\t\t\t\t<source width=\"180\" media=\"(prefers-color-scheme: dark)\" srcset=\"https://sindresorhus.com/assets/thanks/depot-logo-dark.svg\">\n\t\t\t\t\t<source width=\"180\" media=\"(prefers-color-scheme: light)\" srcset=\"https://sindresorhus.com/assets/thanks/depot-logo-light.svg\">\n\t\t\t\t\t<img width=\"180\" src=\"https://sindresorhus.com/assets/thanks/depot-logo-light.svg\" alt=\"Depot logo\">\n\t\t\t\t</picture>\n\t\t\t</div>\n\t\t\t<b>Fast remote container builds and GitHub Actions runners.</b>\n\t\t</a>\n\t\t<br>\n\t\t<br>\n\t\t<br>\n\t</p>\n</div>\n\n---\n\n<br>\n\nExeca runs commands in your script, application or library. Unlike shells, it is [optimized](docs/bash.md) for programmatic usage. Built on top of the [`child_process`](https://nodejs.org/api/child_process.html) core module.\n\n## Features\n\n- [Simple syntax](#simple-syntax): promises and [template strings](docs/execution.md#template-string-syntax), like [`zx`](docs/bash.md).\n- [Script](#script) interface.\n- [No escaping](docs/escaping.md) nor quoting needed. No risk of shell injection.\n- Execute [locally installed binaries](#local-binaries) without `npx`.\n- Improved [Windows support](docs/windows.md): [shebangs](docs/windows.md#shebang), [`PATHEXT`](https://ss64.com/nt/path.html#pathext), [graceful termination](#graceful-termination), [and more](docs/windows.md).\n- [Detailed errors](#detailed-error), [verbose mode](#verbose-mode) and [custom logging](#custom-logging), for [debugging](docs/debugging.md).\n- [Pipe multiple subprocesses](#pipe-multiple-subprocesses) better than in shells: retrieve [intermediate results](docs/pipe.md#result), use multiple [sources](docs/pipe.md#multiple-sources-1-destination)/[destinations](docs/pipe.md#1-source-multiple-destinations), [unpipe](docs/pipe.md#unpipe).\n- [Split](#split-into-text-lines) the output into text lines, or [iterate](#iterate-over-text-lines) progressively over them.\n- Strip [unnecessary newlines](docs/lines.md#newlines).\n- Pass any [input](docs/input.md) to the subprocess: [files](#file-input), [strings](#simple-input), [`Uint8Array`s](docs/binary.md#binary-input), [iterables](docs/streams.md#iterables-as-input), [objects](docs/transform.md#object-mode) and almost any [other type](#any-input-type).\n- Return [almost any type](#any-output-type) from the subprocess, or redirect it to [files](#file-output).\n- Get [interleaved output](#interleaved-output) from `stdout` and `stderr` similar to what is printed on the terminal.\n- Retrieve the output [programmatically and print it](#programmatic--terminal-output) on the console at the same time.\n- [Transform or filter](#transformfilter-output) the input and output with [simple functions](docs/transform.md).\n- Pass [Node.js streams](docs/streams.md#nodejs-streams) or [web streams](#web-streams) to subprocesses, or [convert](#convert-to-duplex-stream) subprocesses to [a stream](docs/streams.md#converting-a-subprocess-to-a-stream).\n- [Exchange messages](#exchange-messages) with the subprocess.\n- Ensure subprocesses exit even when they [intercept termination signals](docs/termination.md#forceful-termination), or when the current process [ends abruptly](docs/termination.md#current-process-exit).\n\n## Install\n\n```sh\nnpm install execa\n```\n\n## Documentation\n\nExecution:\n- ▶️ [Basic execution](docs/execution.md)\n- 💬 [Escaping/quoting](docs/escaping.md)\n- 💻 [Shell](docs/shell.md)\n- 📜 [Scripts](docs/scripts.md)\n- 🐢 [Node.js files](docs/node.md)\n- 🌐 [Environment](docs/environment.md)\n- ❌ [Errors](docs/errors.md)\n- 🏁 [Termination](docs/termination.md)\n\nInput/output:\n- 🎹 [Input](docs/input.md)\n- 📢 [Output](docs/output.md)\n- 📃 [Text lines](docs/lines.md)\n- 🤖 [Binary data](docs/binary.md)\n- 🧙 [Transforms](docs/transform.md)\n\nAdvanced usage:\n- 🔀 [Piping multiple subprocesses](docs/pipe.md)\n- ⏳️ [Streams](docs/streams.md)\n- 📞 [Inter-process communication](docs/ipc.md)\n- 🐛 [Debugging](docs/debugging.md)\n- 📎 [Windows](docs/windows.md)\n- 🔍 [Difference with Bash and zx](docs/bash.md)\n- 🐭 [Small packages](docs/small.md)\n- 🤓 [TypeScript](docs/typescript.md)\n- 📔 [API reference](docs/api.md)\n\n## Examples\n\n### Execution\n\n#### Simple syntax\n\n```js\nimport {execa} from 'execa';\n\nconst {stdout} = await execa`npm run build`;\n// Print command's output\nconsole.log(stdout);\n```\n\n#### Script\n\n```js\nimport {$} from 'execa';\n\nconst {stdout: name} = await $`cat package.json`.pipe`grep name`;\nconsole.log(name);\n\nconst branch = await $`git branch --show-current`;\nawait $`dep deploy --branch=${branch}`;\n\nawait Promise.all([\n\t$`sleep 1`,\n\t$`sleep 2`,\n\t$`sleep 3`,\n]);\n\nconst directoryName = 'foo bar';\nawait $`mkdir /tmp/${directoryName}`;\n```\n\n#### Local binaries\n\n```sh\n$ npm install -D eslint\n```\n\n```js\nawait execa({preferLocal: true})`eslint`;\n```\n\n#### Pipe multiple subprocesses\n\n```js\nconst {stdout, pipedFrom} = await execa`npm run build`\n\t.pipe`sort`\n\t.pipe`head -n 2`;\n\n// Output of `npm run build | sort | head -n 2`\nconsole.log(stdout);\n// Output of `npm run build | sort`\nconsole.log(pipedFrom[0].stdout);\n// Output of `npm run build`\nconsole.log(pipedFrom[0].pipedFrom[0].stdout);\n```\n\n### Input/output\n\n#### Interleaved output\n\n```js\nconst {all} = await execa({all: true})`npm run build`;\n// stdout + stderr, interleaved\nconsole.log(all);\n```\n\n#### Programmatic + terminal output\n\n```js\nconst {stdout} = await execa({stdout: ['pipe', 'inherit']})`npm run build`;\n// stdout is also printed to the terminal\nconsole.log(stdout);\n```\n\n#### Simple input\n\n```js\nconst getInputString = () => { /* ... */ };\nconst {stdout} = await execa({input: getInputString()})`sort`;\nconsole.log(stdout);\n```\n\n#### File input\n\n```js\n// Similar to: npm run build < input.txt\nawait execa({stdin: {file: 'input.txt'}})`npm run build`;\n```\n\n#### File output\n\n```js\n// Similar to: npm run build > output.txt\nawait execa({stdout: {file: 'output.txt'}})`npm run build`;\n```\n\n#### Split into text lines\n\n```js\nconst {stdout} = await execa({lines: true})`npm run build`;\n// Print first 10 lines\nconsole.log(stdout.slice(0, 10).join('\\n'));\n```\n\n### Streaming\n\n#### Iterate over text lines\n\n```js\nfor await (const line of execa`npm run build`) {\n\tif (line.includes('WARN')) {\n\t\tconsole.warn(line);\n\t}\n}\n```\n\n#### Transform/filter output\n\n```js\nlet count = 0;\n\n// Filter out secret lines, then prepend the line number\nconst transform = function * (line) {\n\tif (!line.includes('secret')) {\n\t\tyield `[${count++}] ${line}`;\n\t}\n};\n\nawait execa({stdout: transform})`npm run build`;\n```\n\n#### Web streams\n\n```js\nconst response = await fetch('https://example.com');\nawait execa({stdin: response.body})`sort`;\n```\n\n#### Convert to Duplex stream\n\n```js\nimport {execa} from 'execa';\nimport {pipeline} from 'node:stream/promises';\nimport {createReadStream, createWriteStream} from 'node:fs';\n\nawait pipeline(\n\tcreateReadStream('./input.txt'),\n\texeca`node ./transform.js`.duplex(),\n\tcreateWriteStream('./output.txt'),\n);\n```\n\n### IPC\n\n#### Exchange messages\n\n```js\n// parent.js\nimport {execaNode} from 'execa';\n\nconst subprocess = execaNode`child.js`;\nawait subprocess.sendMessage('Hello from parent');\nconst message = await subprocess.getOneMessage();\nconsole.log(message); // 'Hello from child'\n```\n\n```js\n// child.js\nimport {getOneMessage, sendMessage} from 'execa';\n\nconst message = await getOneMessage(); // 'Hello from parent'\nconst newMessage = message.replace('parent', 'child'); // 'Hello from child'\nawait sendMessage(newMessage);\n```\n\n#### Any input type\n\n```js\n// main.js\nimport {execaNode} from 'execa';\n\nconst ipcInput = [\n\t{task: 'lint', ignore: /test\\.js/},\n\t{task: 'copy', files: new Set(['main.js', 'index.js']),\n}];\nawait execaNode({ipcInput})`build.js`;\n```\n\n```js\n// build.js\nimport {getOneMessage} from 'execa';\n\nconst ipcInput = await getOneMessage();\n```\n\n#### Any output type\n\n```js\n// main.js\nimport {execaNode} from 'execa';\n\nconst {ipcOutput} = await execaNode`build.js`;\nconsole.log(ipcOutput[0]); // {kind: 'start', timestamp: date}\nconsole.log(ipcOutput[1]); // {kind: 'stop', timestamp: date}\n```\n\n```js\n// build.js\nimport {sendMessage} from 'execa';\n\nconst runBuild = () => { /* ... */ };\n\nawait sendMessage({kind: 'start', timestamp: new Date()});\nawait runBuild();\nawait sendMessage({kind: 'stop', timestamp: new Date()});\n```\n\n#### Graceful termination\n\n```js\n// main.js\nimport {execaNode} from 'execa';\n\nconst controller = new AbortController();\nsetTimeout(() => {\n\tcontroller.abort();\n}, 5000);\n\nawait execaNode({\n\tcancelSignal: controller.signal,\n\tgracefulCancel: true,\n})`build.js`;\n```\n\n```js\n// build.js\nimport {getCancelSignal} from 'execa';\n\nconst cancelSignal = await getCancelSignal();\nconst url = 'https://example.com/build/info';\nconst response = await fetch(url, {signal: cancelSignal});\n```\n\n### Debugging\n\n#### Detailed error\n\n```js\nimport {execa, ExecaError} from 'execa';\n\ntry {\n\tawait execa`unknown command`;\n} catch (error) {\n\tif (error instanceof ExecaError) {\n\t\tconsole.log(error);\n\t}\n\t/*\n\tExecaError: Command failed with ENOENT: unknown command\n\tspawn unknown ENOENT\n\t\t\tat ...\n\t\t\tat ... {\n\t\tshortMessage: 'Command failed with ENOENT: unknown command\\nspawn unknown ENOENT',\n\t\toriginalMessage: 'spawn unknown ENOENT',\n\t\tcommand: 'unknown command',\n\t\tescapedCommand: 'unknown command',\n\t\tcwd: '/path/to/cwd',\n\t\tdurationMs: 28.217566,\n\t\tfailed: true,\n\t\ttimedOut: false,\n\t\tisCanceled: false,\n\t\tisTerminated: false,\n\t\tisMaxBuffer: false,\n\t\tcode: 'ENOENT',\n\t\tstdout: '',\n\t\tstderr: '',\n\t\tstdio: [undefined, '', ''],\n\t\tpipedFrom: []\n\t\t[cause]: Error: spawn unknown ENOENT\n\t\t\t\tat ...\n\t\t\t\tat ... {\n\t\t\terrno: -2,\n\t\t\tcode: 'ENOENT',\n\t\t\tsyscall: 'spawn unknown',\n\t\t\tpath: 'unknown',\n\t\t\tspawnargs: [ 'command' ]\n\t\t}\n\t}\n\t*/\n}\n```\n\n#### Verbose mode\n\n```js\nawait execa`npm run build`;\nawait execa`npm run test`;\n```\n\n<img alt=\"execa verbose output\" src=\"media/verbose.png\" width=\"603\">\n\n#### Custom logging\n\n```js\nimport {execa as execa_} from 'execa';\nimport {createLogger, transports} from 'winston';\n\n// Log to a file using Winston\nconst transport = new transports.File({filename: 'logs.txt'});\nconst logger = createLogger({transports: [transport]});\nconst LOG_LEVELS = {\n\tcommand: 'info',\n\toutput: 'verbose',\n\tipc: 'verbose',\n\terror: 'error',\n\tduration: 'info',\n};\n\nconst execa = execa_({\n\tverbose(verboseLine, {message, ...verboseObject}) {\n\t\tconst level = LOG_LEVELS[verboseObject.type];\n\t\tlogger[level](message, verboseObject);\n\t},\n});\n\nawait execa`npm run build`;\nawait execa`npm run test`;\n```\n\n## Related\n\n- [nano-spawn](https://github.com/sindresorhus/nano-spawn) - Like Execa but [smaller](docs/small.md)\n- [gulp-execa](https://github.com/ehmicky/gulp-execa) - Gulp plugin for Execa\n- [nvexeca](https://github.com/ehmicky/nvexeca) - Run Execa using any Node.js version\n\n## Maintainers\n\n- [Sindre Sorhus](https://github.com/sindresorhus)\n- [@ehmicky](https://github.com/ehmicky)\n","publish_time":1791302704120,"_cnpm_publish_time":1791302704120,"dist-tags":{"latest":"10.2.1","next":"2.0.0-alpha.0"}}