Using minit
Mod includes two commond line utilities: minit and mop. You use minit to …; you use mop to optimize an application in production.
The Mod initializer, minit is a multipurpose command line utility that provides a convenient way to kickstart and serve your Mod projects. With minit you can quickly generate default application directories (or projects) or add components to an existing project. Minit also doubles as a single server so you can preview your application locally.
Basic Examples of Using minit
Run the following commands from within your project directory:
-
To create a new project:
$ minit create:app -n app-name
This generates a new directory—app-name, which contains the default Mod application directories with production dependencies—in the current directory.
-
To add a component to a project:
$ minit create:component -n comp-name
This generates a new ui component—comp-name.mod, which contains the default HTML, CSS, and JS files—in the ui directory of the current application directory.
-
To set up a local on-demand server for previewing the current project in the browser:
$ minit serve &
Note: The ampersand (&) option ensures that you don’t have to open a second Terminal window while working on your project.
-
To update to the latest version of minit:
$ sudo npm install -gq minit@latest
-
For a complete list of minit options:
$ minit --help
See also the minit repo on Github.