Codeforces JavaScript Local Runner
Run JavaScript solutions locally inside VS Code with Codeforces-style readline() and print() behavior.
Features
- Sidebar view with multiple test cases
- Per-test Run and global Run All
- Input / Expected Output / Output fields
- Pass/Fail comparison against expected output
- Works on currently active JS editor file
How it works
The extension executes your active editor code in a sandbox and provides:
readline() → reads one line from testcase input
print(...) → appends to output (space-joined, newline-terminated)
console.log/error(...) → also captured in output
Usage
- Open a JavaScript file with your solution.
- Open CF Local Runner from the Activity Bar / Side Bar.
- Add testcases, set input and expected output.
- Click Run on a testcase or Run All.
Requirements
- VS Code 1.85+
- Node.js 18+ recommended
Extension Settings
cfLocal.timeoutMs: execution timeout in milliseconds (default: 2000)
cfLocal.maxOutputChars: max captured output chars (default: 200000)
Known limitations
- This is local execution only (not Codeforces remote judge).
- Infinite loops are stopped by timeout.
| |