Node.js 24
JavaScript and Node.js code execution API
Execute user-submitted JavaScript on Node.js 24 with one HTTPS request. Each run happens in an isolated sandbox with no network access; you get stdout, stderr and the exit code back.
Example: run JavaScript with one request
Submit the source and stdin, then poll GET /v1/executions/{id} until it finishes.
The program
const lines = require("fs").readFileSync(0, "utf8").trim().split("\n");
const nums = lines[0].split(" ").map(Number);
console.log(nums.reduce((a, b) => a + b, 0));
The request
curl -X POST https://api.tatvastack.com/v1/executions \
-H "Authorization: Bearer $CODEFORGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"language":"javascript","source":"const lines = require(\"fs\").readFileSync(0, \"utf8\").trim().split(\"\\n\");\nconst nums = lines[0].split(\" \").map(Number);\nconsole.log(nums.reduce((a, b) => a + b, 0));","stdin":"3 4 5"}'
The result
{
"executionId": "exe_…",
"status": "SUCCEEDED",
"language": "javascript",
"stdout": "12\n",
"stderr": "",
"exitCode": 0,
"durationMs": …
}
FAQ
JavaScript execution questions
Is this Node.js or browser JavaScript?
Node.js 24. There is no DOM; console.log writes to stdout and process.exit sets the exit code.
Can I use npm packages?
Not yet. Built-in Node.js modules are available; npm installs are not.
Can the code make HTTP requests?
No. Sandboxes have no network route and no DNS, so fetch and http calls fail. This is a security guarantee, not a limit to work around.
How is an infinite loop handled?
The run is killed at its time limit and returns status TIMED_OUT.
Run JavaScript in your product today
500 free runs a month during the beta. No servers to manage.