title: How to let parent module to import a child module of the child module in NodeJS
body: <pre><code>Module A
  │
  └─ Module B (devDependency in Module A's package.json)
     │
     └─ Module C (dependency in Module B's package.json)
  </code></pre>
  
  <p>Module B is what I am developing. But I know that module C would be called in Module A with <code>require('Module C')</code>. And the error I am having is <code>Cannot find module 'Module C'</code>.</p>
  
  <p>My current solution is ugly which is:</p>
  
  <p>In index.js of Module B</p>
  
  <pre><code>exports.Module_C = require('Module_C) || require(path.resolve(__dirname, 'node_modules/Module_C/index');
  </code></pre>
  
  <p>In Module A</p>
  
  <pre><code>require('Module_B').Module_C
  </code></pre>
  
  <p>I am hoping there is better way to do it.</p>