@zarejs/cli
v1.3.2
Published
> **@Zarejs/CLI** — The official command-line interface for the **Zare Template Engine**. Designed for the modern JavaScript ecosystem, Zare CLI helps you initialize projects, compile templates, serve with hot-reload, and configure your application with e
Readme
@Zarejs/CLI
@Zarejs/CLI — The official command-line interface for the Zare Template Engine. Designed for the modern JavaScript ecosystem, Zare CLI helps you initialize projects, compile templates, serve with hot-reload, and configure your application with ease.
Features
Initialize New Project
Quickly initialize a new Zare project using predefined templates (currently supports thebasetemplate).Build HTML from Zare Templates
Compile your.zarefiles into static HTML.Serve Project
Start a local server to preview your compiled project.Hot Reloading
Real-time reloads usingchokidarto monitor file changes during development.File-Based Routing
Build routes based on your folder and file structure, enabling navigation setup.
Installation
npm install -g @zarejs/cliUsage
Initialize a New Project
zare init [path]Initializes a new Zare project using the base template.
Supports extensible templates in future releases.
Build HTML Files
zare build [path]Parses .zare files and outputs compiled .html files.
Serve Project
zare serve [path]Starts an Express server to serve compiled files.
Automatically enables hot reloading using chokidar.
Configuration
Customize your setup using zare.config.js:
// zare.config.js
module.exports = {
port: 8185,
staticDir: './static',
pagesDir: './pages',
outDir: './dist',
};File-Based Routing
Automatically builds routes based on your folder structure:
pages/
├── index.zare → /
├── about.zare → /about
├── blog/
├ └── post.zare → /blog/post
└── user/
└── [id].zare → /user/:idContributing
Feel free to fork and contribute! PRs are welcome.
License
MIT License © 2025
