I am currently learning node and express. But when I require and use body-parser my code editor(VS Code) says that it is deprecated. How do I work with this? I will link the image of my editor.
'bodyParser' is deprecated. // If you are using Express 4.16+ you don't have to import body-parser anymore.
body parser package is deprecated. If you are using latest version of express you don't have to install body-parser package.
No need to install body-parser with express , but you have to use it if you will receive post request.
If you facing 'bodyParser' is deprecated.
Just do
app.use(express.urlencoded({extended: true}));
app.use(express.json());
Note: If you are using 4.16.0
or later
express version.
body parser package is deprecated. If you are using latest version of express you don't have to install body-parser package.
You can directly use
app.use(express.urlencoded({extended:true});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With