项目作者: eggjs

项目描述 :
Init egg app helper tools
高级语言: JavaScript
项目地址: git://github.com/eggjs/egg-init.git
创建时间: 2016-07-12T10:04:56Z
项目社区:https://github.com/eggjs/egg-init

开源协议:MIT License

下载


egg-init

NPM version
Node.js CI
Test coverage
npm download

Init egg app helper tools.

Install

  1. npm i egg-init -g
  2. egg-init -h

Create a simple type application

  1. egg-init --type simple [dest]

Or select a boilerplate by yourself

  1. $ egg-init dest
  2. ? Please select a boilerplate type (Use arrow keys)
  3. simple - Simple egg app
  4. plugin - egg plugin

Command

  1. Usage: egg-init [dir] --type=simple
  2. Options:
  3. --type boilerplate type [string]
  4. --dir target directory [string]
  5. --force, -f force to override directory [boolean]
  6. --template local path to boilerplate [string]
  7. --package boilerplate package name [string]
  8. --registry, -r npm registry, support china/npm/custom, default to auto detect [string]
  9. --silent don't ask, just use default value [boolean]
  10. --version Show version number [boolean]
  11. -h, --help Show help [boolean]

Custom a boilerplate

We use npm package to manager boilerplate, you can follow this steps:

  • Create a new repo like egg-boilerplate-plugin
  • Put all files under boilerplate dir
  • Use egg-init --template=PATH to check
  • index.js can define variables which can be useed on template, like {{name}}, but \{{name}} will ignore.
  1. module.exports = {
  2. name: {
  3. desc: 'package-name',
  4. },
  5. pluginName: {
  6. desc: 'plugin-name',
  7. default(vars) {
  8. return vars.name;
  9. },
  10. filter(v) {
  11. return 'egg-' + v;
  12. },
  13. },
  14. description: {
  15. desc: 'my best plugin',
  16. },
  17. author: {
  18. desc: 'author',
  19. default: 'eggjs team'
  20. },
  21. };

License

MIT

Contributors


atian25


fengmk2


thonatos


dead-horse


popomore


killagu


whxaxes


jtyjty99999


edokeh


DanielWLam


Janlaywss


Runrioter


snyk-bot

|
WinjayYu

|
ShirasawaSama

|
supperchong

|
hyj1991

This project follows the git-contributor spec, auto updated at Sat Nov 25 2023 23:06:04 GMT+0800.