Execute JS
project_execute_jsExecute JavaScript code snippets in a workspace to perform computations, file I/O, or prototyping, capturing stdout/stderr with timeout control.
Instructions
Evaluate JavaScript code. Runs node in the workspace, capturing stdout/stderr; supports top-level await and require.
Use when: you need to run a small JS snippet for computation, file I/O via fs, or prototyping.
Avoid when: you need a full shell pipeline (project_shell_run) or a persistent process.
Speed: synchronous node exec with timeout (default 30s, cap 10min); output capped at 1 MiB.
Output: execute_js: stdout_tail, stderr_tail, exit_code, timed_out, ok.
Batch-safe: no
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| argv | No | ||
| code | Yes | ||
| timeout_ms | No |