Skip to main content
The standard code-interpreter template includes JavaScript and TypeScript kernels backed by Node.js tooling.
result = sandbox.run_code("""
const values = [1, 2, 3]
console.log(values.reduce((total, value) => total + value, 0))
""", language="javascript")

print("".join(result.logs.stdout))
Use TypeScript when you want typed snippets:
result = sandbox.run_code("""
const value: number = 42
console.log(value)
""", language="typescript")
Create a context when cells need to share variables, imports, or working directory state.