Được TopGit lập chỉ mục từ metadata GitHub: sindresorhus/execa có 7.6k sao, viết chủ yếu bằng JavaScript. Process execution for humans
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Sindre's open source work is supported by the community
Special thanks to:
Fast remote container builds and GitHub Actions runners.
Execa runs commands in your script, application or library. Unlike shells, it is optimized for programmatic usage. Built on top of the child_process core module.
Features
Simple syntax: promises and template strings, like zx.
Script interface.
No escaping nor quoting needed. No risk of shell injection.
Execute locally installed binaries without npx.
Improved Windows support: shebangs, PATHEXT, graceful termination, and more.
Detailed errors, verbose mode and custom logging, for debugging.
Pipe multiple subprocesses better than in shells: retrieve intermediate results, use multiple sources/destinations, unpipe.
Split the output into text lines, or iterate progressively over them.
Strip unnecessary newlines.
Pass any input to the subprocess: files, strings, Uint8Arrays, iterables, objects and almost any other type.
Return almost any type from the subprocess, or redirect it to files.
Get interleaved output from stdout and stderr similar to what is printed on the terminal.
Retrieve the output programmatically and print it on the console at the same time.
Transform or filter the input and output with simple functions.
Pass Node.js streams or web streams to subprocesses, or convert subprocesses to a stream.
Exchange messages with the subprocess.
Ensure subprocesses exit even when they intercept termination signals, or when the current process ends abruptly.
Install
npm install execa
Documentation
Execution:
▶️ Basic execution
💬 Escaping/quoting
💻 Shell
📜 Scripts
🐢 Node.js files
🌐 Environment
❌ Errors
🏁 Termination
Input/output:
🎹 Input
📢 Output
📃 Text lines
🤖 Binary data
🧙 Transforms
Advanced usage:
🔀 Piping multiple subprocesses
⏳️ Streams
📞 Inter-process communication
🐛 Debugging
📎 Windows
🔍 Difference with Bash and zx
🐭 Small packages
🤓 TypeScript
📔 API reference
Examples
Execution
Simple syntax
import {execa} from 'execa';
const {stdout} = await execa`npm run build`;
// Print command's output
console.log(stdout);
// Similar to: npm run build < input.txt
await execa({stdin: {file: 'input.txt'}})`npm run build`;
File output
// Similar to: npm run build > output.txt
await execa({stdout: {file: 'output.txt'}})`npm run build`;
Split into text lines
const {stdout} = await execa({lines: true})`npm run build`;
// Print first 10 lines
console.log(stdout.slice(0, 10).join('\n'));
Streaming
Iterate over text lines
for await (const line of execa`npm run build`) {
if (line.includes('WARN')) {
console.warn(line);
}
}
Transform/filter output
let count = 0;
// Filter out secret lines, then prepend the line number
const transform = function * (line) {
if (!line.includes('secret')) {
yield `[${count++}] ${line}`;
}
};
await execa({stdout: transform})`npm run build`;
sindresorhus/execa thuộc nhóm Frontend trên TopGit, cùng 10 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về sindresorhus/execa ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/sindresorhus/execa là nguồn chính thức.
sindresorhus/execa có bao nhiêu sao?
sindresorhus/execa có 7.6k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/sindresorhus/execa. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
sindresorhus/execa có phải mã nguồn mở không?
Có — sindresorhus/execa phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/sindresorhus/execa.
sindresorhus/execa có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho sindresorhus/execa. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
sindresorhus/execa là gì?
sindresorhus/execa (sindresorhus/execa) là dự án JavaScript trên GitHub. Theo mô tả gốc: Process execution for humans
sindresorhus/execa so với các dự án Frontend khác thế nào?
sindresorhus/execa được TopGit xếp vào nhóm Frontend, với 7.6k sao GitHub và viết bằng JavaScript. Xem trang chủ đề Frontend trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về execa?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về execa.