Skip to content
Koa' application generator for 1.x and 2.x( Express-style and support all middlewares include async/await )
JavaScript HTML CSS Shell
Branch: master
Clone or download
Pull request Compare This branch is 50 commits behind ykfe:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin
docs
templates1
templates2
test
.gitignore
LICENSE
README.md
appveyor.yml
package.json
study-koa.md
test.sh

README.md

koa-generator

http://koajs.com/

Koa Logo

Koa application generator.

NPM Version NPM Downloads

Features

  • Express-style
  • Support koa 1.x(已支持)
  • Support koa 2.x(已支持所有的koa中间件写法,依赖runkoa,不需要了解babel)

Installation

$ npm install -g koa-generator

with 2 commands

  • koa (Support koa 1.x)
  • koa2 (Support koa 2.x)

Quick Start 1.x

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

Create the app:

$ koa /tmp/foo && cd /tmp/foo

Install dependencies:

$ npm install

Rock and Roll

$ npm start

Quick Start 2.x

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

Create the app:

$ koa2 /tmp/foo && cd /tmp/foo

Install dependencies:

$ npm install

Rock and Roll

$ npm start

more detail see koa2-demo

Command Line Options

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

-h, --help          output usage information
-V, --version       output the version number
-e, --ejs           add ejs engine support (defaults to jade)
    --hbs           add handlebars engine support
-H, --hogan         add hogan.js engine support
-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

目前选项-c还没有实现

Git Branch Details

  • master = koa generator
  • tpl 是koa 1.x模板
  • tpl_2.x 是koa 2.x模板

License

MIT

You can’t perform that action at this time.