What is the different between express and express-

2020-07-02 09:59发布

问题:

As you might know, express released 4.1.0 recently. Now you can not use the command line "express" directly via npm intall -g express which is working just well in version 3.x. When I read the Readme in the package, I saw express-generator. After npm install -g express-generator, I can use the command line. So,what's the difference? Only for global install?

回答1:

With express 4 the express boilerplate generator command line was extracted to it's own module 'express-generator' because the generator app did not really share code with express web framework and express and generator app can be released independently.

I guess this was a step into the right direction to decouple the web framework from the boilerplate/skeleton generator since this makes express even more lightweight and leverages tools like yeoman that focus on generating things.



回答2:

The difference is that with Express 4, a lot of middleware and other things that were not necessary for "core" Express were exported into separate modules. The Express project generator happened to be one of those things.