title: Writing a jquery plugin in coffeescript - how to get "(function($)" and "(jQuery)"?
body: <p>I am writing a jquery plugin in coffeescript but am not sure how to get the function wrapper part right.</p>
  
  <p>My coffeescript starts with this:</p>
  
  <pre><code>$.fn.extend({
      myplugin: -&gt;
          @each -&gt;
  </code></pre>
  
  <p>Which creates the javascript with a function wrapper:       </p>
  
  <pre><code>(function() {
    $.fn.extend({
        myplugin: function() {
            return this.each(function() {
  </code></pre>
  
  <p>but I want a '$' passed in like this:   </p>
  
  <pre><code>(function($) {
    $.fn.extend({
  </code></pre>
  
  <p>Similar for the ending I have... nothing in particular in coffeescript.<br>
  I get this in javascript:</p>
  
  <pre><code>})();
  </code></pre>
  
  <p>But would like this:</p>
  
  <pre><code>})(jQuery);
  </code></pre>
  
  <p>Does anyone know how to achieve this with the coffeescript compiler?
  Or what is the best way to get this done within coffeescript?</p>