egg-init
Init egg app helper tools.
Last updated 4 years ago by atian25 .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install egg-init -g
SYNC missed versions from official npm registry.

egg-init

NPM version Node.js CI Test coverage [![David deps][david-image]][david-url] Known Vulnerabilities npm download

Init egg app helper tools.

Install

$ npm i egg-init -g
$ egg-init -h

Create a simple type application

$ egg-init --type simple [dest]

Or select a boilerplate by yourself

$ egg-init dest
? Please select a boilerplate type (Use arrow keys)
❯ simple - Simple egg app
  plugin - egg plugin

Command

Usage: egg-init [dir] --type=simple

Options:
  --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]
  -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.

    module.exports = {
      name: {
        desc: 'package-name',
      },
      pluginName: {
        desc: 'plugin-name',
        default(vars) {
          return vars.name;
        },
        filter(v) {
          return 'egg-' + v;
        },
      },
      description: {
        desc: 'my best plugin',
      },
      author: {
        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

License

MIT

Contributors


atian25


fengmk2


thonatos


dead-horse


popomore


killagu


whxaxes


jtyjty99999


edokeh


DanielWLam


Janlaywss


Runrioter


snyk-bot


WinjayYu


ShirasawaSama


supperchong

This project follows the git-contributor spec, auto updated at Wed Nov 10 2021 08:41:48 GMT+0800.

Current Tags

  • 2.3.1                                ...           latest (4 years ago)

42 Versions

  • 2.3.1                                ...           4 years ago
  • 2.3.0                                ...           4 years ago
  • 2.2.0                                ...           6 years ago
  • 2.0.1                                ...           6 years ago
  • 2.0.0                                ...           6 years ago
  • 1.17.3                                ...           6 years ago
  • 1.17.2                                ...           7 years ago
  • 1.17.1                                ...           7 years ago
  • 1.17.0                                ...           7 years ago
  • 1.16.1                                ...           7 years ago
  • 1.16.0                                ...           7 years ago
  • 1.15.1                                ...           7 years ago
  • 1.15.0                                ...           8 years ago
  • 1.14.1                                ...           8 years ago
  • 1.14.0                                ...           8 years ago
  • 1.13.0                                ...           8 years ago
  • 1.12.0                                ...           8 years ago
  • 1.11.0                                ...           9 years ago
  • 1.10.1                                ...           9 years ago
  • 1.10.0                                ...           9 years ago
  • 1.9.2                                ...           9 years ago
  • 1.9.1                                ...           9 years ago
  • 1.9.0                                ...           9 years ago
  • 1.8.1                                ...           9 years ago
  • 1.8.0                                ...           9 years ago
  • 1.7.0                                ...           9 years ago
  • 1.6.1                                ...           9 years ago
  • 1.6.0                                ...           9 years ago
  • 1.5.1                                ...           9 years ago
  • 1.5.0                                ...           9 years ago
  • 1.4.2                                ...           9 years ago
  • 1.4.1                                ...           9 years ago
  • 1.4.0                                ...           9 years ago
  • 1.3.0                                ...           9 years ago
  • 1.2.1                                ...           10 years ago
  • 1.2.0                                ...           10 years ago
  • 1.1.1                                ...           10 years ago
  • 1.1.0                                ...           10 years ago
  • 1.0.2                                ...           10 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
  • 0.0.1                                ...           10 years ago
Downloads
Today 0
This Week 0
This Month 15
Last Day 0
Last Week 15
Last Month 1
Dependencies (15)
Dev Dependencies (10)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |