Mach vs Express.js
When comparing Mach vs Express.js, the Slant community recommends Express.js for most people. In the question“What are the best node.js web frameworks?” Express.js is ranked 1st while Mach is ranked 11th. The most important reason people chose Express.js is:
Setting up a new Express project is very easy. It consists of installing a handful of libraries through NPM run a single `npm install` and everything is ready to go.
Specs
Ranked in these QuestionsQuestion Ranking
Pros
Pro Streaming
Mach has some pretty cool streaming functionalities built directly into it, if your web app provides any audio/video/data streaming features, you can consider using Mach to build it.
Pro Composability
Since Mach already is asynchronous (stateless) which means your logic is implemented by using promises (then objects
); hence your functions are pretty independent and composable.
Pro Simplicity
No complex layers between plain HTTP requests and the corresponding JS functions invoked. Which in turn means each GET/POST/PUT or any other HTTP request is directly mapped to a Javascript function. Hence leading to a huge increase in performance for your app
Pro Robust
One of the distinguishing features of Mach is it's robustness, errors won't be terminating your complete app, instead they'll bubble up so you can handle them gracefully.
Pro Asynchronous
Like most of the Node.js's core, Mach is an asynchronous web framework too. Each response (of a request) can simply be hooked up to a then
method so that its result or the reason for failure can be retrieved after the action is complete. If you're wondering what async operations are, here's a pretty good explanation for you
Pro Setting up is very easy
Setting up a new Express project is very easy. It consists of installing a handful of libraries through NPM run a single npm install
and everything is ready to go.
Pro Great routing API
Express' extremely powerful routing API allows developers to do tasks ranging from building a REST API to building the routes for a simple web app and then take it to the next level by using route parameters and query strings.
Pro Great for beginner Node.js programmers
With a little learning curve, it is a good choice for new NodeJS developers to get started quickly. Express boasts great, thorough documentation.
Pro Express.js is in the Node.js Foundation Incubator Program
Node.js Foundation
Announcement here
The Node.js Foundation is a Collaborative Project at The Linux Foundation. Linux Foundation Collaborative Projects are independently funded software projects that harness the power of collaborative development to fuel innovation across industries and ecosystems.
Pro Relatively mature
Being a somewhat old Node.js web app framework and being one of the most widely used frameworks, Express.js has matured quite a lot during all that time. It's more stable than its competitors and a huge community backing it.
Pro Support for a lot of plugins
Express takes advantage of Node's NPM to distribute and install countless plugins made by third parties which solve almost anything a developer would want to do with Express.
Pro Has the largest userbase
It's by far the most popular framework for node.
Pro Great supportive community
Express has a big community with a lot of guides and tutorials written about it by developers that have been using it for quite some time.
Pro Good Oauth/Facebook integration with connect module
You can easily add oAuth integration/social logins to your next web app without much hassle, using this authentication middleware for connect.
Pro Has detailed information
Very simple and fast.
Pro Lightweight
Pro Massive ecosystem of middleware
If you have not already checked out the Express.js ecosystem of middleware, you should.
Cons
Con No single recommended way of doing something
Express considers itself to be a "minimalistic unopinionated framework", it basically lets the developer determine how their project will be organized. On one hand, this gives anyone terrific power and flexibility to use any library they want for a certain task and to organize their project structure however they want. But on the other hand, there's no single recommended way of organizing things, which can be a trap for beginners and experienced developers alike and result in unmaintainable projects.