meeko init
Creates a standalone SSR project without the framework, with a .meeko component, its Node server and Vite.
meeko init creates the component engine starter: a server-rendered page hydrated in the browser, without file-based routing, meeko.config.ts, app/ or server/. It is the starting point for using .meeko components inside your own server or learning how SSR and hydration work without the framework. For a complete application, use meeko init-framework.
It does not install dependencies or overwrite files: it writes the project and tells you the next step.
Usage#
npx @meekojs/meeko init mi-appProyecto creado en C:\proyectos\mi-app
Siguiente paso: cd C:\proyectos\mi-app && npm install && npm run devType#
meeko init <directorio>Parameters#
| Parameter | Type | Default | Description |
|---|---|---|---|
<directorio> |
path | required | Project folder. Created if absent; if it exists, it may only contain .git (a folder just created with git init) or a package.json with lockfiles (package-lock.json, pnpm-lock.yaml, yarn.lock, bun.lock, bun.lockb), pnpm-workspace.yaml, node_modules, .npmrc and .git; the same as meeko init-framework. Through 1.6, a folder containing only .git was rejected. Its name, lowercased and hyphenated, becomes the new package.json's name. |
Result#
mi-app/
├── .gitignore node_modules/, dist/, .meeko/
├── README.md
├── index.html
├── package.json
├── server.mjs Node server: Vite in development, dist/ with --production
├── tsconfig.json with allowArbitraryExtensions and rootDirs over .meeko/types
├── vite.config.ts plugins: [meeko()]
└── src/
├── App.meeko a counter with props and a signal
├── entry-client.ts hydrates with props and server state
└── entry-server.ts renders with renderWithStatepackage.json pins @meekojs/meeko to the exact version that created the project (compiled code and runtime must match), adds @types/node, typescript and vite and declares these scripts:
| Script | Command |
|---|---|
dev |
node server.mjs |
check |
meeko types src/App.meeko && tsc --noEmit |
build |
npm run check && vite build --outDir dist/client --manifest && vite build --ssr src/entry-server.ts --outDir dist/server |
start |
node server.mjs --production |
The message says pnpm instead of npm if the folder already had pnpm-lock.yaml. If the directory is the current one, it omits cd.
Examples#
A new project#
npx @meekojs/meeko init contador
cd contador
npm install
npm run dev
# http://localhost:4173In the current folder, with the package already installed#
mkdir contador && cd contador
pnpm add @meekojs/meeko
pnpm exec meeko init .
pnpm install
pnpm run devpackage.json, pnpm-lock.yaml and node_modules are preserved: init adds its scripts and dependencies to the existing package.json.
Check and build#
npm run check # generates .meeko/types/src/App.d.meeko.ts and runs tsc
npm run build # dist/client and dist/server
npm start # serves dist/ with SSR at 127.0.0.1:4173MEEKO_PORT (or PORT) changes the port of server.mjs; the address is always 127.0.0.1, and you change it by editing server.mjs, which is now project code.
Common mistakes#
A folder containing files#
meeko init mi-app # mi-app ya has src/ e index.htmlEl destino no está vacío: C:\proyectos\mi-app (.gitignore, index.html, README.md, server.mjs, src, tsconfig.json, vite.config.ts)The list shows entries that prevent project creation; nothing is written. A folder containing only .git is accepted since 1.7; with lockfiles or node_modules but no package.json, the message ends in (sin package.json). Messages have been in Spanish since 1.7.
meeko init mi-app-nuevaA package.json with other scripts or dependencies#
# package.json with "scripts": { "dev": "vite" } or with "dependencies": { "react": "…" }
meeko init .El destino ya define el script dev: C:\proyectos\mi-app or El destino tiene otras dependencias: C:\proyectos\mi-app. The starter only merges with a newly created package.json.
npm init -y && meeko init .Omit the directory#
meeko initFalta el directorio de init, with usage and exit code 1.
meeko init .Notes#
- Engine, not framework. The starter has no routes, layouts, API, sessions or
meeko dev:server.mjsis an example server that renders/withrenderWithStateand serves assets. The project decides everything else. - Types.
meeko types src/App.meekowrites component declarations in.meeko/types/, andtsconfig.jsonoverlays them onsrc/withrootDirs; this is whycheckruns it beforetsc. - Shutdown.
server.mjscloses HTTP and Vite onSIGINTandSIGTERM, preserves both causes if both fail and exits with an error code. - Windows and POSIX. Scripts use
nodeandvitewithout shell syntax, so they work the same in PowerShell,cmdand POSIX. - Node 24.
package.jsondeclares"engines": { "node": ">=24" }.