title: How to reload node modules?
body: <p>nodejs seems to cache the modules when loaded the first time. Therefore any modifications to the module are not reflected despite reloading the module, as the subsequent times it is simply picked from cache. </p>
  
  <p>However despite deleting the cache using:</p>
  
  <pre><code>delete require.cache[require.resolve(module)]
  </code></pre>
  
  <p>it no longer shows the module in cache, however the modifications to module are still not reflected. </p>
  
  <p>I understand that deleting require.cache is only deleting a link to the object and not the actual object( in case of circular dependencies ) and this might be causing the problem?</p>
  
  <p>I even deleted the entire require.cache object, however to no avail. </p>
  
  <p>EDIT: Tried manual gc as well, still doesn't work</p>
  
  <pre><code>node --expose-gc
  m = require('module')
  // modify 'module'
  delete require.cache
  delete m
  global.gc()
  m = require('module')
  //Changes not reflected
  </code></pre>