title: How to delete all pictures of an directory
body: <p>I am trying to delete all pictures of an directory. But getting error on directory path. And also dont know how to get all pictures path &amp; delete all of them.</p>
  
  <p>My directory structure :</p>
  
  <pre><code>server
    -&gt; app.js
  tmp
    -upload
    -- pic.jpg
    -- pic2.jpg
    -- pic3.jpg
  </code></pre>
  
  <p>I have tried this :</p>
  
  <pre><code>var dir = require('../tmp/upload');
  var fs = require('fs');
  var promise = require('bluebird');
  fs.readdir(dir).then(function(file) {
      console.log(data)
  
  }).catch(function(err){
      console.log
  })
  </code></pre>
  
  <p>But getting error : Cannot find module '../tmp/upload'</p>
  
  <p>Need help to get the path &amp; all pictures on upload folder &amp; delete them. </p>
  
  <p>Thanks in advance</p>