Packages
The NML monorepo ships seven focused packages. Install only what you need.
@nml-lang/compiler-ts
npm install @nml-lang/compiler-tsCore TypeScript compiler — lexer, parser, renderer, and CompilerAdapter singleton. The engine that powers everything else. Use this directly for custom integrations with any runtime.
@nml-lang/cli
bunx @nml-lang/cli initThe nml binary — init, dev, build, deploy, and test commands. Scaffolds new projects, runs Vite dev server with HMR, detects libraries, and deploys to Cloudflare Workers.
@nml-lang/vite-plugin
bun add -d @nml-lang/vite-pluginVite transform plugin — imports *.nml files as ES modules with HMR. Each NML file exports a render(context) function and a pre-rendered html string.
@nml-lang/router
npm install @nml-lang/routerUniversal file-based routing layer. Maps views/ directory to URL paths automatically. Supports dynamic segments like [id].nml → /users/:id.
@nml-lang/bun-server
npm install @nml-lang/bun-serverZero-config Bun HTTP server with file-based routing built in. No Hono, no Workers required. Ideal for local development or non-edge deployments.
@nml-lang/mcp-server
bun run /path/to/mcp-server/src/index.tsstdio MCP server for AI coding assistants. Exposes nml_compile, nml_lint, and nml_list_components tools. Compatible with Windsurf, Claude Desktop, Cursor, and Zed.
worker-template
scaffolded via nml initHono + Cloudflare Workers project template. Includes wrangler.jsonc, vite.config.ts, components.nml, and example views. The fastest way to get an NML edge app running.