ExpressJS 5.0: What’s New !
Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.
ExpressJS is one of the best frameworks for Node.js and it is also a member of the MEAN Stack family which makes 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:
```bash
$ npm install express@5.0.0-alpha.2 — save
```
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 the errors will be shown right away.
# ExpressJS 5.0 Changelog Here is the list of changes (as of the alpha 2 release) that will affect you as a user of Express. # List of Deprecated Things Removed:
*** app.del**
```javascript
app.del(‘/res’, (req, res) => res.send(‘deleted’));
//4: express deprecated app.del: Use app.delete instead
//5: TypeError: app.del is not a function
```
*** app.param(name)**
```javascript
// Old
app.get(‘/users/:name’, (req, res) => {
res.send(User.find(req.param(‘name’)));
});
//4: express deprecated req.param(name): Use req.params, req.body, or req.query instead
//5: TypeError: req.param is not a function
// New
app.get(‘/user/:name’, (req, res) => {
res.send(User.find(req.params.name));
});
```
*** req.acceptsCharset**
```javascript
// The req.acceptsCharset() changes to req.acceptsCharsets) array
req.acceptsCharsets()
```
*** req.acceptsEncoding**
```javascript
// The req.cceptsEncoding() changes to req.acceptsEncodings() array
req.acceptsEncodings()
```
*** req.acceptsLanguage**
```javascript
// The req.acceptsLanguage() changes to req.acceptsLanguages() array
req.acceptsLanguages()
```
*** res.json(status, obj) **
```javascript
// The res.status(status).json(obj) changes to res.status(status).json(obj)
res.status(status).json(obj)
```
*** res.jsonp(status, obj) **
```javascript
// The res.jsonp(status, obj) changes to res.status(status).jsonp(obj)
res.status(status).jsonp(obj)
```
# Conclusion Express 5 is still in alpha so there are bound to be changes. 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 release.