Express Generator Without Jade

后端 未结 6 1215
南方客
南方客 2021-02-07 03:46

I am trying to generate an express skeleton, using the express generator. So it would be this:

$ npm install express-generator -g

However, it

6条回答
  •  名媛妹妹
    2021-02-07 04:01

    Try running this command in command prompt:

    express --help
    

    It will give you the express generator help:

      Usage: express [options] [dir]
    
      Options:
    
        -h, --help          output usage information
            --version       output the version number
        -e, --ejs           add ejs engine support
            --hbs           add handlebars engine support
            --pug           add pug engine support
        -H, --hogan         add hogan.js engine support
            --no-view       generate without view engine
        -v, --view  add view  support (ejs|hbs|hjs|jade|pug|twig|vash) (defaults to jade)
        -c, --css   add stylesheet  support (less|stylus|compass|sass) (defaults to plain css)
            --git           add .gitignore
        -f, --force         force on non-empty directory
    

    Source: https://expressjs.com/en/starter/generator.html

    The above options give you the list of "view engines".

    Now, simply type:

    express -{your choice view engine}


    For example using express -e:

    This sets the EJS engine as your view handler and removes jade. EJS has the look and feel of HTML with the added ability to inject values via their template system.

提交回复
热议问题