title: Non-deprecated alternative to body-parser in Express.js
body: <p>I am going through the book <em>Web Development with Node and Express</em> and have hit a snag.</p>
  
  <p>I was instructed to put the below in my application file, but it looks like <code>body-parser</code> is deprecated and will not work. How can I achieve the same functionality?</p>
  
  <p>This is my current code:</p>
  
  <pre><code>app.use(require('body-parser')());
  
  app.get('/newsletter', function(req, res){
  
      // we will learn about CSRF later...for now, we just
      // provide a dummy value
      res.render('newsletter', { csrf: 'CSRF token goes here' });
  });
  
  app.post('/process', function(req, res){
  
      console.log('Form (from querystring): ' + req.query.form); 
      console.log('CSRF token (from hidden form field): ' + req.body._csrf); 
      console.log('Name (from visible form field): ' + req.body.name); 
      console.log('Email (from visible form field): ' + req.body.email); res.redirect(303, '/thank-you');
  });
  </code></pre>