Beautify Express body-parser JSON syntax error
npm install bodyparser-json-error 
```
npm install bodyparser-json-error --save
`javascript
var express = require('express');
var bodyParser = require('body-parser');
var bodyParserError = require('bodyparser-json-error');
var app = express();
app.use(bodyParser.urlencoded({
extended: true
}));
app.use(bodyParser.json());
// Beautify body parser json syntax error
app.use(bodyParserError.beautify());
`
`javascript`
app.use(bodyParserError.beautify({status: 500 , res: {msg: 'You sent a bad JSON !'}}));
The output:
HTTP Status Code: 500
`javascript`
{
"msg": "You sent a bad JSON !"
}
{msg: 'Invalid JSON'}Tests
To run the test suite, first install the dependencies, then run npm test:`bash
$ npm install
$ npm test
``