Quick Start
Start using Zare CLI to build Zare websites without setting up the backend server
Installation
Global Installation
npm i -g @zarejs/cliDevDependency Installation
npm i --save-dev @zarejs/cliAbout Zare CLI
@zarejs/cli is an official, open source command line interface for creating, building and serving the Zare template engine code without setting up a backend server.
Prerequisites
- Install Node.js on your machine, for more information visit https://nodejs.org/
- NPM or any package manager (e.g.
yarn,pnpm) should be installed
Useful Commands
Creating A New Project
Using npx
npx zare init myappUsing zare
If you have installed
@zarejs/cliglobally.
zare init myappHit enter and it will create a new directory where required files and folders were setup
Adding Dependencies
npx zare add ButtonThis command will add Button component from ZareUI (IsmailBinMujeeb/zare/main). You can also add dependencies from other github projects.
I DON’T LIKE ZAREUI
npx zare add Button USERNAME/REPO/BRANCH [projectDir]It will add Button as a dependency from specified github project. And last option is project path which is ”.” by default.
Start Serving
npx zare serve myappThis start a local express server, myapp is should be a valid project directory path which contains pages folder and zare config file.
Build HTML
npx zare build myappThis will build the static html files from your zare files.