Move existing Node.js apps to MoroJS with predictable, mechanical rewrites. No magic, no rewriting your business logic — just the syntactic shifts that get you running on @morojs/moro.
Express is shipping today. The rest are next on the roadmap — open an issue or PR if you need one sooner.
Mechanical rewrites for the most common Express patterns. Battle-tested codemod with full test coverage.
View guideSchema-first migration with hook and plugin mapping to MoroJS modules and middleware.
Coming soonContext-style middleware translated into MoroJS request/response handlers.
Coming soonDecorator-driven controllers and providers mapped onto MoroJS modules and dependency injection.
Coming soonThe Express codemod walks your project tree and rewrites Express imports plus the usual factory and middleware helpers to their MoroJS equivalents. It is intentionally small and predictable — you keep ownership of the rest.
See exactly what will change before touching a single file.
bash
Add --write to commit the changes in place.
bash
Once the diff looks good, install MoroJS and remove Express. The rewritten imports already point at @morojs/moro.
bash
A representative file the codemod will rewrite for you.
javascript
javascript
The full set of mechanical swaps the codemod performs.
| Express | MoroJS |
|---|---|
require('express') | require('@morojs/moro') |
import ... from 'express' | import ... from '@morojs/moro' |
express() | createApp() |
express.Router() | createRouter() |
express.json(...) | json(...) |
express.urlencoded(...) | urlencoded(...) |
express.static(path) | staticFiles(path) |
<dir>The root of the codebase to scan. Required positional argument.
--writeApply the changes in place. Without this flag the script runs as a dry run.
--ext=ts,jsComma-separated extension filter. Defaults to ts,tsx,js,mjs,cjs.
The script automatically skips node_modules, dist, build, .git, .next, and coverage.
app.listen() callback style and 4-arg error middleware are already compatible — nothing to rewrite.import { Router as R } from 'express' have their source updated, but local names stay as you wrote them.You are now on MoroJS. Here is where to go next to take advantage of the things Express never gave you.
Replace ad-hoc route files with chainable, type-safe routes that infer params, queries, and bodies.
Read the docsBring Zod, Joi, Yup, or class-validator into the request lifecycle without writing custom middleware.
Read the docsTake the same MoroJS app to Node, Lambda, Cloudflare Workers, or Vercel Edge with no rewrites.
Read the docsThe migrations repo is intentionally small and easy to read. Open an issue with the patterns you want automated, or contribute a codemod for your stack.