title: Accessing the callback from a node module
body: <p>simple Q: How do I access the callback from <code>rimraf</code>? See <a href="https://www.npmjs.com/package/rimraf" rel="nofollow">here</a>.</p>
  
  <p>Can't wrap my head around how to structure the code - I'm trying for example:</p>
  
  <pre><code>var rimraf = require('rimraf');
  var removeDir = rimraf(p, callback);
  
  var p = 'docs/mydirectory';
  removeDir(p, function(cb){
    console.log(cb)
  });
  </code></pre>
  
  <p>But receiving <code>callback undefined</code>.. I'm probably doing something completely wrong! Can someone point me in the right direction? Cheers</p>