ExpressJS 5.0: What’s New

Express is a minimal and flexible Node.js web application framework that provides robust web and mobile application features.

ExpressJS is one of the best frameworks for Node.js, and it is also a member of the MEAN Stack family, making it very popular.

There are many version of ExpressJS since the first released from version 0.0.1, which started the project in 2010–01–03 to 4.16.2 in 2017–10–09
Express 5.0 is still in the alpha release stage, but here is a preview of the changes that will be in the release.

Express 5 is not very different from Express 4: The changes to the API are not as significant as from 3.0 to 4.0. Although the basic API remains the same, there are still breaking changes; in other words, an existing Express 4 program might not work if you update it to use Express 5.

Installing ExpressJS 5.0

To install the latest alpha and to preview Express 5, enter the following command in your application root directory:

After installing the newest version, you can then run your automated test to see failures and fix the errors according to the updates listed below. After addressing test failures, run your app to see what errors occur. If your app uses any of the deprecated methods, Express will show the errors right away.

ExpressJS 5.0 Changelog

Here is the list of changes (as of the alpha 2 release) that will affect you as an Express user.

List of Deprecated Things Removed:

  1. app.del

2. app.param(name)

3. req.acceptsCharset

4. req.acceptsEncoding

5. req.acceptsLanguage

6. res.json(status, obj)

7. res.jsonp(status, obj)

8. res.send(body, status)

9. res.send(status)

10. res.sendfile()

Improvements

The following are the list of improvements that ExpressJS 5.0 is coming with:

  1. Add support for Promises in all handlers
  2. Bring back app.router which is just generally useful for directly calling the router.
  3. Make sure 3.x-style app.use(app.router) does not explode.
  4. Fix views to resolve paths async.
  5. Make query parser option default to ‘simple’.
  6. Make req.host actually, return the host.
  7. Make req.query a getter instead of added by middleware.
  8. Make res.render always async callback to hide sync view engines.
  9. Make res.sendFile use the “ETag” application setting.
  10. Make res.status throw on invalid argument type.
  11. Make express.static use the “ETag” application setting.
  12. New path matching syntax.
  13. Provide separate locals and options to view the engine.
  14. Remove Express 3.x middleware error stubs.
  15. Support Node.js core HTTP/2 implementation.
  16. Support non-core HTTP prototypes (e.g. http2, shot and others).
  17. Use mime-types instead of mime.
  18. Use path-is-absolute module for absolute path detection

Conclusion

Express 5 is still in alpha, so there are bound to change. Take a look at this [pull request](https://github.com/expressjs/express/pull/2237) if you want to see an updated list of changes for the release.

Thank you for reading my article.

Here at my blog or medium, I regularly write about backend development, digital marketing and content management system. To read my future posts, join my publication or click ‘Follow’ Also, feel free to connect with me via Twitter, Facebook, Instagram.

If you are interested in backend development (or you’re an internet enthusiast) both (Mobile | Web | Desktop) videos, subscribe to my Youtube channel, we will be posting a collection of help full tutorials and guides like this one for artisans.

If you enjoy this post, make sure to let us know and share it with your friends and subscribe to my growing channel.

Sharing is caring.

A Software Developer who’s geared towards building high performing and innovative products following best practices. Blog @ https://masteringbackend.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store