mimibox
v0.4.0
Published
WASM-sandboxed Python & JavaScript code execution CLI
Readme
MimiBox
WASM-sandboxed code execution. Python and JavaScript, no containers, no VMs.
mimibox python 'print(1+1)'
# → 2
mimibox js 'console.log(Array.from({length:5}, (_,i) => i**2))'
# → [0,1,4,9,16]Install
npm install -g mimiboxOr run directly:
npx mimibox python 'print("hello")'Usage
# Inline code
mimibox python 'import math; print(math.pi)'
mimibox js 'console.log("hello")'
# From file
mimibox python -f script.py
mimibox js -f app.js
# From stdin
echo 'print("hello")' | mimibox python
cat script.js | mimibox js
# Options
mimibox python --timeout 10000 'slow_function()'
mimibox js --memory 100 'big_computation()'Exit codes
0— success1— execution error2— bad arguments
Output
stdout— execution outputstderr— errors
How It Works
Both run entirely inside WASM. No filesystem access, no network access from inside the sandbox.
Security
- Python:
jsglobals: Object.create(null)blocks sandbox escape to Node.js globals - JavaScript: QuickJS runs in a true WASM sandbox with no host access
- Timeout: 30s default, configurable via
--timeout - Memory: QuickJS 50MB default, configurable via
--memory - Output: truncated at 1MB
Browser Playground
A browser-based playground is also included at public/index.html — open it directly or serve it:
npx serve publicFile Structure
src/
cli.ts CLI entry point
python.ts Pyodide wrapper
javascript.ts QuickJS wrapper
public/
index.html Browser playground