Auto-generating an Express app

The process of creating the manifest file, the app.js file, the views, and other directories and files can become a tedious chore as we start to work on multiple projects. To automate this process, we can use the express command-line tool.

To refresh you memory, we first encountered the express command-line tool while learning how to install Express. We were told that it generates Express app skeletons; now we have a fairly good idea what it might do.

Using its help option (-h), let's ask express how it works and what its options are:

$ express –h

  Usage: express [options] [directory]

  Options:

    -h, --help          output usage information
    -V, --version       output the version number
    -s, --sessions      add session support
 -e, --ejs ...

Get Express Web Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.