title: Import hooks in Node.js
body: <p>I've came across the problem which is just fine solved by import hooks in Python. Is there similar mechanism in Node.js, that allows one to intercept any calls to require() after the hook was installed?</p>
  
  <p>I've tried following:</p>
  
  <pre><code>originalRequire = global.require;
  
  global.require = function(module) {
      console.log('Importing ' + module + '...');
  
      return originalRequire(module);
  };
  </code></pre>
  
  <p>However this does nothing. Any ideas?</p>