title: Using NPM module in Backbone with RequireJS
body: <p>Hejsa,
  I'm writing a webapp, which consists of a Node backend (Express server), which serves a Backbone app to the clients.
  The Backbone app uses RequireJS to load the modules used.
  I would like to use Ag-grid clientside, which can be included as an NPM module.
  <a href="https://www.ag-grid.com/javascript-grid-getting-started/index.php" rel="nofollow">https://www.ag-grid.com/javascript-grid-getting-started/index.php</a></p>
  
  <p>How can I reference this NPM module from Backbone?</p>
  
  <p><strong>Project structure</strong></p>
  
  <p><code>./node_modules
  ./src/package.json
  ./src/app (Node backend + Express server)
  ./src/public
  ./src/public/main.coffee (contains requireJs config)
  ./src/public/scripts (Backbone views, models, etc)
  </code></p>
  
  <p><strong>main.coffee</strong></p>
  
  <pre><code>require.config
      baseUrl: '../scripts/'
      paths:
          jquery: '//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min'
          jqueryui: '//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min'
          underscore: '//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min'
          ...
  </code></pre>
  
  <p>I would like to include the ag-grid NPM module here, but without having to reference the very top <code>./node_modules</code> folder as <code>../../../node_modules/ag-grid/dist/ag-grid</code> (<em>didn't count the levels..</em>).
  Also, I'd like if possible to avoid a second package.js, and a secondary <code>npm install</code></p>
  
  <p>Any help related specifically to this project structure?
  Secondarily, is there any better way to structure such a project? (Node backend serving a Backbone webapp)</p>
  
  <p>Thanks</p>