title: Is it possible to set the root directory of a node module?
body: <p>If I publish a node module with source files in a <code>src</code> directory, and people would like to import a file in their project, they would need to specify the full path from the module.</p>
  
  <p>Example:</p>
  
  <p>Structure:</p>
  
  <pre><code>my-module
  --src
  ----index.js
  ----something-else.js
  </code></pre>
  
  <p><code>package.json</code>:</p>
  
  <pre><code>{
    "name": "my-module",
    "root": "src/index.js"
  }
  </code></pre>
  
  <p>Implementation:</p>
  
  <pre><code>import myModule from 'my-module';
  import somethingElse from 'my-module/src/something-else';
  </code></pre>
  
  <p>(or using <code>require</code>)</p>
  
  <pre><code>var myModule = require('my-module');
  var somethingElse = require('my-module/src/something-else');
  </code></pre>
  
  <p>Is there any way to set up the package so that it knows <code>src</code> is my sources root, allowing users to require <code>somethingElse</code> with <code>my-module/something-else</code>?</p>
  
  <p>If this isn't possible, would it be a good/bad idea to pull the files out of <code>src</code> on prepublish?</p>