Skip to content

Runtime Comparison

tywrap supports five runtime configurations. Choose based on your environment.

Feature Matrix

FeatureNode.jsBunDeno (experimental)Browser (Pyodide)HTTP
Python subprocessyesyesyesnono
Deno Deploy / serverlessnononoyesyes
Apache Arrow transportyesyesyesno (JSON only)yes
Virtual environment supportyesyesyesnoServer-side
Process pooling (experimental)yesyesyesnono
Development hot reloadyesnonoManual bridge reloadExternal
Tested in CIyesyesno (untested)yesyes

Import Paths

RuntimeImport
Node.jsimport { NodeBridge } from 'tywrap/node'
Bunimport { NodeBridge } from 'tywrap/node'
Deno (experimental, untested)import { NodeBridge } from 'npm:tywrap'
Browserimport { PyodideBridge } from 'tywrap/pyodide'
HTTPimport { HttpBridge } from 'tywrap/http'

Decision Guide

Do you need subprocess-based Python execution?
├── Yes → Does your environment support subprocess?
│   ├── Node.js or Bun → Use NodeBridge (import from 'tywrap/node' or 'tywrap')
│   ├── Deno (experimental, untested) → Use NodeBridge with --allow-run=python3
│   └── Deno Deploy / serverless → Continue ↓
└── No (browser, edge, serverless) →
    ├── Can you load ~50MB WebAssembly? → Use PyodideBridge
    └── Need heavy Python libs or can't load WASM → Use HttpBridge

Bridge Reference

BridgeExportGuide
NodeBridgetywrap/nodeNode.js · Bun · Deno
PyodideBridgetywrap/pyodideBrowser
HttpBridgetywrap/httpHTTP

Released under the MIT License.