title: Selecting random file but then deleting it
body: <p>I have some code that selects a random file from a folder then logs it, after its done logging I want it to be deleted but I can't seem to delete it.</p>
  
  <p>The path to the randomly selected file is stored as a variable.</p>
  
  <pre><code>const trash = require('trash');
  var fs = require('fs'),
      path = require('path'),
      files_memes = fs.readdirSync('/Users/jackb/Desktop/pup/Pictures/reddit_sub_memes')
  var filename = (random_file());
  var imgPATH = path.join(__dirname, '/Users/jackb/Desktop/pup/Pictures/reddit_sub_memes/' + filename);
  const del = require('del');
  
  function random_file(){
    var allFiles = (files_memes)
    return allFiles[Math.floor(Math.random() * allFiles.length)];
  }
  console.log(filename);
  console.log(imgPATH);
  (async () =&gt; {
      const deletedPaths = await del(['imagePATH']);
  
      console.log('Deleted files and directories:\n', deletedPaths.join('\n'));
  })();
  </code></pre>
  
  <p>I expect the logged file to be deleted.</p>