title: Meteor - How to load a JS library for only specific users?
body: <p>I'm designing an administration interface with graphics and so on and I'm using the Highcharts Library (140kb). I want this file to be loaded only for admin users. What would be the best way to do it?</p>
  
  <p><a href="http://empire5.com/development/meteor-using-iron-router-to-conditionally-load-javascript-libraries/" rel="nofollow">I just saw that we could use Iron-Router to conditionally load JavaScript </a> but I don't like the idea to handle this kind of things inside the router as below:</p>
  
  <pre><code>Router.map -&gt;
    @route 'admin',
      path: '/admin'
      template: 'admin'
      action: -&gt;
        $.getScript '/js/moment.min.js', (data, textStatus, jqxhr) -&gt;
          if jqxhr.status is 200
            @render()
  </code></pre>
  
  <p><strong>NOTE</strong>: I wrote a little blog post <a href="http://journal.gentlenode.com/meteor-15-load-a-library-only-for-specific-users/" rel="nofollow">to load a library for only specific users with Meteor.</a></p>