substack/node-browserify — pull request #180 by jhnns (2012-06-27 13:40:04+00:00)
Title: Change module caching behavior in prelude.js

I noticed that browserify manages the module caching slightly different compared to nodejs. nodejs provides a `cache`-object attached to `require()` as described [here](http://nodejs.org/docs/latest/api/globals.html#globals_require_cache). Thus a module can decide to reload another module.

In order to write modules that run in both environments browserify should do it like node.

As you can see in the attached code it's not necessary to change a lot. Unfortunately I couldn't find a place to write tests for it, but it seems like it doesn't break the old tests.