title: How can I wait In Node.js (JavaScript)? l need to pause for a period of time
body: <p>I'm developing a console script for personal needs. I need to be able to pause for an extended amount of time, but, from my research, Node.js has no way to stop as required. It’s getting hard to read users’ information after a period of time... I’ve seen some code out there, but I believe they have to have other code inside of them for them to work such as:</p>
  
  <pre class="lang-js prettyprint-override"><code>    setTimeout(function() {
      }, 3000);
  </code></pre>
  
  <p>However, I need everything after this line of code to execute after the period of time.</p>
  
  <p>For example, </p>
  
  <pre class="lang-js prettyprint-override"><code>    // start of code
      console.log('Welcome to my console,');
  
      some-wait-code-here-for-ten-seconds...
  
      console.log('Blah blah blah blah extra-blah');
      // end of code
  </code></pre>
  
  <p>I've also seen things like</p>
  
  <pre class="lang-js prettyprint-override"><code>    yield sleep(2000);
  </code></pre>
  
  <p>But Node.js doesn't recognize this.</p>
  
  <p>How can I achieve this extended pause?</p>