Installation
Install MiiaJS and a server adapter for your runtime.
Scaffold with CLI (recommended)
The fastest way to start a new project is with the @miiajs/cli:
bunx @miiajs/cli new my-app
npx @miiajs/cli new my-app
pnpm dlx @miiajs/cli new my-app
yarn dlx @miiajs/cli new my-app
cd my-app
The CLI will prompt you to choose a runtime (Bun, Deno, or Node.js), generate the project structure, install dependencies, and configure TypeScript - all in one step. Then run:
bun run dev
npm run dev
pnpm dev
yarn dev
If you prefer to set things up manually, follow the steps below.
Manual setup
Core package
bun add @miiajs/core
npm install @miiajs/core
pnpm add @miiajs/core
yarn add @miiajs/core
Server adapters
MiiaJS exposes a standard fetch handler. Choose a server adapter for your runtime:
Bun & Deno
No additional package needed. app.listen() auto-detects the runtime.
Node.js
bun add @miiajs/node-server
npm install @miiajs/node-server
pnpm add @miiajs/node-server
yarn add @miiajs/node-server
uWebSockets.js
bun add @miiajs/uws-server uWebSockets.js@uNetworking/uWebSockets.js#v20.64.0
npm install @miiajs/uws-server uNetworking/uWebSockets.js#v20.64.0
pnpm add @miiajs/uws-server uNetworking/uWebSockets.js#v20.64.0
yarn add @miiajs/uws-server uNetworking/uWebSockets.js#v20.64.0
TypeScript configuration
MiiaJS requires ES2025 for TC39 decorator support:
{
"compilerOptions": {
"target": "ES2025",
"module": "nodenext",
"verbatimModuleSyntax": true
}
}
For the full list of packages, see Packages.