title: Get random line from .txt file then remove the line from .txt file
body: <p>need some help on this one.
  I'm creating a Discord bot in Node.js.</p>
  
  <p>What i that to do: </p>
  
  <blockquote>
    <p>Read a random line from a local .txt file.</p>
    
    <p>Then forward it to Discord (I know how)</p>
    
    <p>Then delete that exact line i got, from the local .txt file.</p>
  </blockquote>
  
  <p>Almost like an array. But, a local one, that i can always fast edit.</p>
  
  <p>I'm still new to Node and Javascript, so i learn by trying and reading, but i got stuck here, that's why i need to professional help :-)</p>
  
  <p><a href="https://i.stack.imgur.com/AjRXA.png" rel="nofollow noreferrer">Chart</a></p>
  
  <p>Hope i made you understand my problem, and you can help me.</p>
  
  <p>I have the following:</p>
  
  <pre><code>let fs = require('fs');
  let randomNumber = 
  fs.readFileSync('./resources/array.txt').toString().split("\n");
  let item = randomNumber[Math.floor(Math.random() * randomNumber.length)];
  </code></pre>
  
  <p>Which outputs random number from the file.</p>