Looking at this a second time, I think this might be dangerous, as it assumes that the user hasn't exposed a global in the browser called `module`. The assumption that `window` isn't available in Node is a lot safer. Is there some global that Node-Webkit exposes or some special namespaced method that's easy to test availability of?