Home » Nodejs » When should I use express.js over a standalone node.js

When should I use express.js over a standalone node.js

Posted by: admin November 29, 2017 Leave a comment

Questions:

Node.js is a javascript environment
Express is a framework What is a software framework? for Node.js

Why and when is useful to use express framework over Node.js standalone? I mean, is this framework just a set of ready functions and modules that can be used easier than writing code from 0?

I’m asking this because I found lots of tutorials and guides on node with express, but just a few on standalone node.js.

Answers:

As you suspect, Express.js just makes it easier to write a Node.js webapp. You could build anything you could with Express.js without it.

Many factors go into whether to use a given framework or not, such as available support, documentation, future development, does it fit needs of project, etc. Express.js is the most popular Node.js web application framework, but that doesn’t mean it should automatically be your choice. Here’s a link to an article which you may find interesting, and contains alternatives to Express.js which may be worth exploring – https://scotch.io/bar-talk/the-future-of-expressjs-and-alternatives

You can also check out this tutorial on writing a Node.js application without a framework – http://www.nodebeginner.org/

Questions:
Answers:

The reason it is famous because Easy learning curve.There are lot of inbuilt, third-party middleware compatible with it. It overall provides complete structure in clean syntax. And yes you are right ,it is just a set of ready functions and modules that can be used easier than writing code from 0. It saves time. There lot of resources on nodejs with express.

But The same functionality can be done without expressjs which requires research.