tomoat / koa2-generator

Koa2' application generator support ejs|hbs|hjs|jade|pug|twig|vash|nunjucks template engine
MIT License
12 stars 1 forks source link
generator koa koa2 koa2-generator koajs

koa-generator

Koa' application generator.

NPM Version NPM Downloads Linux Build Windows Build Gratipay Greenkeeper badge

Installation

$ npm install -g koa2-generator

Quick Start

The quickest way to get started with koa2 is to utilize the executable koa2(1) to generate an application as shown below:

Create the app:

if you use hogan template engine

$ koa2 --view hogan ./app && cd ./app

if you want use yarn manage your application modules

$ npm i -g yarn 

Install dependencies:

$ npm install
or
$ yarn install

Start your Koa app at http://localhost:3000/:

$ npm start
or 
$ yarn start

Command Line Options

This generator can also be further configured with the following command line flags.

Usage: koa2 [options] [dir]

options:

-h, --help          output usage information
-v, --version       output the version number
-e, --ejs           add ejs engine support
    --hbs           add handlebars engine support
    --pug           add pug engine support
    --hjs           add hogan.js engine support
    --njk           add nunjucks engine support
    --view <engine> add view <engine> support (ejs|hbs|hogan|jade|pug|twig|vash) (defaults to jade)
-c, --css <engine>  add stylesheet <engine> support (less|stylus|compass|sass) (defaults to plain css)
    --git           add .gitignore
-f, --force         force on non-empty directory

License

MIT