SDK
Interpreters

Interpreters

The Interpreter API allows you to run code in different programming languages in your sandbox.

API

The Interpreter API is available under client.interpreters.

Running Code

The Interpreter API includes built-in support for running code in different programming languages:

// Run JavaScript code
const jsResult = await client.interpreters.javascript("'Hello from Node.js!'");
 
// Run Python code
const pythonResult = await client.interpreters.python("'Hello from Python!'");

These interpreters will automatically return the last expression as output, but you can print values to the console at any point for multiple outputs.

💡

Note that the interpreters will not resolve until the interpretation resolves. We are open to changing this behavior if you have any feedback or suggestions! Or you can always implement your own by using commands.