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.