esem-bridge is a runtime bridge between JavaScript and Python. Install it from npm, callDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Crane04/esem/llms.txt
Use this file to discover all available pages before exploring further.
python("./your_module.py"), and every function, class, and constant in that module becomes an awaitable JavaScript value — no FastAPI server, no HTTP endpoints, no subprocess boilerplate.
Quickstart
Get from
npm install to your first Python function call in under two minutes.How It Works
Learn how the JSON-RPC bridge, Python worker, and proxy system fit together.
API Reference
Full reference for
python(), shutdown(), PythonError, and more.CLI Reference
Run JS files with
python: import syntax using the esem run command.Why esem-bridge?
Connecting Python and JavaScript typically means standing up a FastAPI or Flask server, writing HTTP routes, handling serialization, and managing two separate processes. esem-bridge collapses all of that into a single function call.Key features
Two import styles
Use the
python() helper or the python: import syntax — whichever fits your workflow.Classes & instances
Instantiate Python classes from JavaScript. Instance methods are callable proxies.
Full type bridge
None, bool, int, float, str, list, and dict map cleanly across the boundary.Rich error handling
Python exceptions cross the bridge with the original message, type name, and full traceback.
No servers
Communication is JSON-RPC over stdin/stdout — zero network overhead, no open ports.
Virtualenv support
Point
ESEM_PYTHON at any interpreter — system Python, a venv, or conda.