jsxrun
v0.1.1
Published
Run a single JSX file as a React app — no setup required
Maintainers
Readme
jsxrun
Run a single JSX file as a React app — no setup required.
npx jsxrun app.jsxInstall
npm i -g jsxrunUsage
jsxrun <file.jsx|tsx> [options]Your file must have a default export of a React component:
import { useState } from "react";
export default function App() {
const [count, setCount] = useState(0);
return <button onClick={() => setCount(count + 1)}>Count: {count}</button>;
}Then run it:
jsxrun app.jsxOpen http://localhost:3000 and you're done.
Options
| Flag | Description |
| --- | --- |
| -p, --port <number> | Port to serve on (default: 3000) |
| -o, --open | Open in browser automatically |
| -b, --build | Output a single .html file instead of starting a server |
| -h, --help | Show help |
Build a single HTML file
jsxrun app.jsx --buildOutputs app.html — a self-contained file you can open directly in a browser or share. No server needed.
How it works
- esbuild bundles your JSX on-the-fly
- React 19 is loaded from esm.sh via importmap (no local install needed)
- Live-reload via SSE — edit your file, browser refreshes automatically
--buildinlines your bundled JS into a single HTML file- Supports
.jsxand.tsxfiles
License
MIT
