title: Node js how to run axios.get every 2 seconds?
body: <p>I am kinda of a newbie to node js, Here is what i am trying to do:  i am looping through a json file full of links of our website via the map function (around 3000 links), inside the loop i am doing a axios get for each link and getting the response status code(will do other things in the future). But i want to run the axios get only like every 2 seconds or 5 seconds otherwise i am overwhelming the webserver. I am trying to input async await but it's still too fast and server is taking a hit (i am technically DDos-ing my own website). I put a SetTimeout around the axios but that doesn't seem like it worked, since in the console results are printing way too fast. <strong>so the question is, how do i make each axios.get request wait every 2 seconds before running in the map loop?.</strong></p>
  
  <pre><code>var axios = require('axios');
  const fs = require('fs');
  var statusCheck = 0;
  
  var main = [];
  let rawdata = fs.readFileSync('C:/Users/jay/Documents/crawl/filtered2.json');
  let jsonParsed = JSON.parse(rawdata);
  
  jsonParsed.map(async(line) =&gt; {
  
      var encodeLink = encodeURI(line.link);
      const response = await axios.get(encodeLink).catch((err) =&gt; {
          var Status_ErrorsCatchaxios = {
              "status Code": err.response.status ? err.response.status : "No status code available",
              "Page title:": $('title').text() ? $('title').text() : 'No title avaialble',
              "Original Link": encodeLink ? encodeLink : "No Original Link Available",
              "errorCode": err
          }
          main.push(Status_ErrorsCatchaxios)
      })
      try {
          console.log(response.status)
  
          statusCheck = statusCheck + 1;
          console.log("Link: ", statusCheck)
      } catch (error) {
          console.log(error)
      }
  })
  </code></pre>