Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the different between express and express-generator

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?

like image 339
YDSS Avatar asked Apr 29 '14 14:04

YDSS


People also ask

Should we use Express generator?

For learning Express, it's best to stick with the generator. Once you get a handle on how everything interacts and you feel comfortable making changes to the general structure, you could move onto other things or simply put together your own framework if you find yourself using the same general setup for projects.

How do I start my Express generator?

You can run the application generator with the npx command (available in Node. js 8.2. 0). Then load http://localhost:3000/ in your browser to access the app.


2 Answers

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.

like image 140
saintedlama Avatar answered Oct 19 '22 03:10

saintedlama


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.

like image 40
mscdex Avatar answered Oct 19 '22 01:10

mscdex