Skip to navigation

runCode

Referenced In

Fields

FieldTypeDescriptionDefault
runCodeobject(Run code (detailed))Required. Assemble and run code.—

Examples

{
"runCode": {
"language": "javascript",
"code": "console.log(`Hello, ${require('os').userInfo().username}!`);"
}
}
{
"runCode": {
"language": "py",
"code": "print('Hello from Python')"
}
}
{
"runCode": {
"language": "bash",
"code": "echo \"Hello from Bash!\"",
"timeout": 20000,
"exitCodes": [
0
],
"stdio": "Hello from Bash!"
}
}
{
"runCode": {
"language": "javascript",
"code": "process.exit(1);",
"exitCodes": [
1
]
}
}
{
"runCode": {
"language": "python",
"code": "print('Hello from Python!')",
"exitCodes": [
0
],
"stdio": "Hello from Python!",
"path": "python-output.txt",
"directory": "output",
"maxVariation": 0.1,
"overwrite": "aboveVariation"
}
}
{
"runCode": {
"language": "javascript",
"code": "require('http').createServer((req, res) => res.end('ok')).listen(8088);",
"background": {
"name": "api",
"waitUntil": {
"port": 8088
}
},
"timeout": 15000
}
}