title: Using CDN vs Installing library by NPM
body: <p>I recently started using NPM, but I don't understand how the files in <code>node_modules</code> are added to my <code>index.html</code>.</p>
  <p><strong>Case 1: CDN</strong></p>
  <p>For example, if I want to use jQuery via CDN, it is so simple! I add the CDN link to a <code>&lt;script&gt;</code> tag on my <code>index.html</code> file and <code>$</code> is immediately available.</p>
  <pre class="lang-html prettyprint-override"><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js&quot;&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;script&gt;
  $(document).ready(function(){
      $('body').css('background','red');
  });
  &lt;/script&gt;
  &lt;/body&gt; 
  &lt;/html&gt; 
  </code></pre>
  <p><strong>Case 2: NPM</strong></p>
  <p>Now I'm trying to use node modules and npm rather than CDNs. I have done the following:</p>
  <ol>
  <li>Created <code>package.json</code> by using <code>npm init --yes</code></li>
  <li>Installed the jQuery package with <code>npm install jquery --save</code></li>
  </ol>
  <p>Now, my project folder looks like this:
  <a href="https://i.stack.imgur.com/dEb9H.png" rel="noreferrer"><img src="https://i.stack.imgur.com/dEb9H.png" alt="Directory in windows showing a node modules folder, index.html file, and package.json file." /></a></p>
  <p>I have removed the script tag with the link to the jQuery CDN from <code>index.html</code>, but I don't understand how to add jQuery from <code>node_modules</code>?</p>
  <p>I am doing this on a browser.</p>