title: Can you pack multiple native modules into the same NPM package?
body: <p>I've written a cross-platform <a href="https://nodejs.org" rel="noreferrer">nodejs</a> native module in <a href="https://en.wikipedia.org/wiki/C_(programming_language)" rel="noreferrer">C</a> using <a href="http://cmake.org/" rel="noreferrer">cmake</a>, <a href="https://www.musl-libc.org/" rel="noreferrer">musl</a>, plus a few abstractions and carefully placed <a href="https://gcc.gnu.org/onlinedocs/cpp/Ifdef.html" rel="noreferrer">#ifdefs</a>. </p>
  
  <p>It is built into a module using <a href="https://www.npmjs.com/package/cmake-js" rel="noreferrer">cmake-js</a> and I have 3 build servers: <code>Windows</code>, <code>Mac</code> and <code>Linux</code> doing the buliding so I have 3 native modules that work fine on all the platforms.</p>
  
  <p>We have an internal <a href="https://www.npmjs.com" rel="noreferrer">NPM</a> repository that I could go ahead and publish to so that other teams within the company can simply <code>npm install module</code> to get my module.</p>
  
  <p>The thing is, it's kind of messy that the client would need to pick a module based on the platform they're on (i.e. I would deploy all 3 modules from each of the build servers) so I would rather deploy a single module by somehow merging together the 3 platform specific modules.</p>
  
  <p><strong>Is this possible and how do I structure the internals of such a module?*</strong>  </p>
  
  <p>Does, for example, <a href="https://www.npmjs.com/package/bindings" rel="noreferrer">bindings</a> figure out the platform and find the appropriate <code>.node</code> file?</p>
  
  <p><em>&ast;I don't want to include the code and have the client compile it as that puts a pretty large burden on the client (they would be expecting to be able to write a simple script using Javascript, for example, and use my module - it would be a shock that they need to set up C build chains, worry about the platform their script is running on etc, etc, etc).</em></p>