Name: egg-init
Owner: egg
Description: Init egg app helper tools
Created: 2016-07-12 10:04:56.0
Updated: 2018-05-21 10:47:08.0
Pushed: 2018-05-04 03:19:28.0
Size: 55
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Init egg app helper tools.
m i egg-init -g
g-init -h
simple
type applicationg-init --type simple [dest]
g-init dest
ease select a boilerplate type (Use arrow keys)
mple - Simple egg app
ugin - egg plugin
e: egg-init [dir] --type=simple
ons:
type boilerplate type [string]
dir target directory [string]
force, -f force to override directory [boolean]
template local path to boilerplate [string]
package boilerplate package name [string]
registry, -r npm registry, support china/npm/custom, default to auto detect [string]
silent don't ask, just use default value [boolean]
version Show version number [boolean]
, --help Show help [boolean]
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.
le.exports = {
me: {
desc: 'package-name',
uginName: {
desc: 'plugin-name',
default(vars) {
return vars.name;
},
filter(v) {
return 'egg-' + v;
},
scription: {
desc: 'my best plugin',
thor: {
desc: 'author',
default: 'eggjs team'
Write unit test, see npm scripts
at egg-boilerplate-simple
Add your package name to egg-init-config's package.json config.boilerplate
property
Publish your package to npm