The simplest web framework and site generator yet.
- Minimal yet powerful: Mastro fills in the few missing pieces that aren't yet built into the platform: a file-based router and a handful of composable functions to return standard Response objects.
- Static site generation and on-demand server rendering of HTML or JSON works all the same.
- No bloat: written in just ~700 lines of TypeScript, Mastro feels like a framework but is just a library.
- No client-side JavaScript (until you add some): create MPA websites that load blazingly fast.
- No bundler (until you add one): your code arrives in the browser exactly how you wrote it.
- No magic: use normal
<img>and<a>tags referencing HTTP-first assets. - No VC-money: no eventual enshitification – selling a service is not what we're interested in.
- No update treadmill: we use web standards instead of relying on complex dependencies.
- No lock-in: swap out calls to the Mastro library later on. Or fork it – it's only ~700 lines after all.
Deploy to GitHub Pages without installing anything: Get started
After installing Deno, either use the Mastro template for Deno or run:
deno run -A npm:@mastrojs/[email protected]
Either use the Mastro template for Node.js or run:
pnpm create @mastrojs/[email protected]
(npm and yarn also work, but pnpm is recommended.)
Either use the Mastro template for Bun or run:
bun create @mastrojs/[email protected]
To deploy your website, see Different ways to run Mastro.
The core of Mastro is tiny. But to get you started quickly for common use-cases, there is a growing list of extensions that are tailored to be used with Mastro. Usually, it's just a single file wrapping a carefully chosen external dependency.
- @mastrojs/markdown – generate HTML from markdown
- @mastrojs/images – transform images (resize, compress, etc)
- @mastrojs/og-image – generate Open Graph images from text
- @mastrojs/feed – generate an Atom feed
- Reactive Mastro – a tiny client-side reactive GUI library for MPAs
It’s still early days. But we’re looking to build an inclusive community, where people of all kinds of backgrounds and experience levels feel welcome and safe. A place to ask questions and learn new things, where people help each other out.
Do you have a question, need help, or would like to talk about future plans? Please start a GitHub Discussion.
Something not working as expected or confusing? We consider that a bug. Please open a GitHub issue.