Once you have the Grind Installer installed, it’s easy to setup a new project. Just run the following command:
grind new project-name
grind command provides a couple of different options for you when setting up a new project. You can run
grind new --help for full details, here’s a quick list of options:
webis the default option, so there’s no need to pass it explicitly. A web project includes a fully functional example site built on Grind, and includes dependencies for asset compilation and optimization, template rendering and HTML helpers. _
reactis similar to the web template but for React! A React project includes a fully functional example site built on Grind and React, and includes dependencies for asset compilation and optimization. *
apishould be used if you’re building, well, an API. The API project will be barebones with enough to get you started, but not too much that it starts slowing you down.
--skip-packages* By default
grind newwill run
npm installfor you, if you’d prefer to run it yourself and save time during project creation, you can pass this option.
--prefer-npm* Yarn is used by default if it’s detected, you can use
--prefer-npmto override that behavior and install using
--tag=??* Without this flag, the installer will grab a list of available tags and pick the newest one. If you’d prefer to install an older version of Grind (or a future, unreleased, version), you can explicitly pass in a tag via
--tag=0.6.0. Passing in the name of a branch or a commit hash as a tag is also supported.
If you’re prefer not to install Grind’s installer, you can quickly clone one of Grind’s example repositories to get started:
Editgit clone --depth 1 https://github.com/grindjs/example-web.git project-namecd project-namerm -fr .git && git init # Clear out the existing example git history and start fresh