Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 19
    +1 just for Doug's quote. I needed someone to phrase out what I also believed in :) Commented Mar 17, 2013 at 9:36
  • 1
    Excellent answer! If you would like to start a node repl with reloading enabled check out this gist. Commented Oct 9, 2013 at 4:16
  • 2
    awesome. I would add this to the require.uncache function. ``` // see github.com/joyent/node/issues/8266 Object.keys(module.constructor._pathCache).forEach(function(k) { if (k.indexOf(moduleName)>0) delete module.constructor._pathCache[k]; }); ``` Say you've required a module, then uninstalled it, then reinstalled the same module but used a different version that has a different main script in its package.json, the next require will fail because that main script does not exists because it's cached in Module._pathCache Commented Aug 26, 2014 at 20:59
  • crap. my comment is terrible. I couldn't neatly add code in this comment and it's too late to edit, so I answered. @Ben Barkay if you could edit your question to add the little snippet of code to your require.uncache Commented Aug 26, 2014 at 21:06
  • Thanks @bentael, I've added this to my answer. Commented Aug 28, 2014 at 14:43