Use SimpleBox with custom OCI images to run Node.js, shell scripts, system tools, or any language — not just Python.
SimpleBox runs any OCI container image, so you’re not limited to Python. Use it to run Node.js, Go, Rust, shell scripts, or any CLI tool — just pick the right image and call exec().
The node:20-bookworm image includes both Node.js and Python 3, so you can combine languages in a single box without installing anything.
Python
Node.js
multi_language.py
import asyncioimport boxliteasync def main(): async with boxlite.SimpleBox(image="node:20-bookworm") as box: # Run Python — already included in the bookworm image py_result = await box.exec( "python3", "-c", "print('Hello from Python')" ) print(f"Python: {py_result.stdout.strip()}") # Run Node.js node_result = await box.exec( "node", "-e", "console.log('Hello from Node.js')" ) print(f"Node.js: {node_result.stdout.strip()}") # Use Python to generate data, Node.js to process it await box.exec("sh", "-c", "python3 -c \"import json; print(json.dumps([1,2,3,4,5]))\" > /tmp/data.json" ) result = await box.exec("sh", "-c", "node -e \"const d = require('/tmp/data.json'); console.log('Sum:', d.reduce((a,b) => a+b, 0))\"" ) print(f"Cross-language: {result.stdout.strip()}")if __name__ == "__main__": asyncio.run(main())
multi_language.js
import { SimpleBox } from '@boxlite-ai/boxlite';async function main() { const box = new SimpleBox({ image: 'node:20-bookworm' }); try { // Run Python — already included in the bookworm image const pyResult = await box.exec( 'python3', '-c', "print('Hello from Python')" ); console.log(`Python: ${pyResult.stdout.trim()}`); // Run Node.js const nodeResult = await box.exec( 'node', '-e', "console.log('Hello from Node.js')" ); console.log(`Node.js: ${nodeResult.stdout.trim()}`); // Use Python to generate data, Node.js to process it await box.exec('sh', '-c', `python3 -c "import json; print(json.dumps([1,2,3,4,5]))" > /tmp/data.json` ); const result = await box.exec('sh', '-c', `node -e "const d = require('/tmp/data.json'); console.log('Sum:', d.reduce((a,b) => a+b, 0))"` ); console.log(`Cross-language: ${result.stdout.trim()}`); } finally { await box.stop(); }}main();
Use slim or minimal images for faster startup. Full images like ubuntu:latest work but are larger and slower to pull on first use. After the first pull, images are cached locally.