Skip to content

Commit ccf1b02

Browse files
committed
feat(child_process): add exec and execFile functions
Implements exec() and execFile() for the child_process module, matching the Node.js API. Key features: - Callback-based API with (error, stdout, stderr) signature - Shell execution for exec(), direct execution for execFile() - Support for options: cwd, env, timeout, maxBuffer, killSignal, shell - Preserves partial output data on timeout - Uses Persistent<Function> pattern for async callback safety
1 parent b6a70bc commit ccf1b02

File tree

5 files changed

+1477
-17
lines changed

5 files changed

+1477
-17
lines changed

API.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ Everything else inherited from [Uint8Array](https://developer.mozilla.org/en-US/
114114
115115
[spawn](https://nodejs.org/api/child_process.html#child_processspawncommand-args-options)
116116

117+
[exec](https://nodejs.org/api/child_process.html#child_processexeccommand-options-callback)
118+
119+
[execFile](https://nodejs.org/api/child_process.html#child_processexecfilefile-args-options-callback)
120+
117121
## console
118122

119123
[Console](https://nodejs.org/api/console.html#class-console)

modules/llrt_child_process/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ llrt_utils = { version = "0.7.0-beta", path = "../../libs/llrt_utils", default-f
2020
rquickjs = { git = "https://github.com/DelSkayn/rquickjs.git", version = "0.10.0", features = [
2121
"std",
2222
], default-features = false }
23-
tokio = { version = "1", features = ["process"], default-features = false }
23+
tokio = { version = "1", features = ["process", "time"], default-features = false }
2424

2525
[target.'cfg(unix)'.dependencies]
2626
libc = { version = "0.2", default-features = false }
2727

2828
[dev-dependencies]
2929
llrt_test = { path = "../../libs/llrt_test" }
30+
tokio = { version = "1", features = ["rt"] }

0 commit comments

Comments
 (0)