title: Parse numbers from query strings with bodyParser.urlencoded() in express.js
body: <p>In the front end, I use jQuery to send a GET request like this:</p>
  
  <pre><code>$.get('/api', {foo:123, bar:'123'), callback);
  </code></pre>
  
  <p>according to jQuery doc, the 2nd parameter is a plain object that will be converted into query string of the GET request.</p>
  
  <p>In my node express back end, I use body-parser like this: </p>
  
  <pre><code>const bodyParser = require("body-parser");
  app.use(bodyParser.urlencoded({ extended: true }));
  app.get('/api', (req, res) =&gt; {
    console.log(req.query) // req.query should be the {foo:123, bar:'123'} I sent
  });
  </code></pre>
  
  <p>However, <code>req.query</code> turns out to become <code>{foo:'123', bar: '123'}</code> where all the numbers were converted to strings. How can I revert to the exact same object I sent from front end?
  Thanks!</p>