At compile time, CoffeeScript transfers your code to an anonymous function and applies it. You must export your public interface in the expected manner for your environment.
(exports || window).publicMethod = (foo, bar) -> foo + bar
Then you need to use require() in node.js and by referencing the window object in the browser.
There are other ways to do this in the browser. Take a look at RequireJS .
lawnsea May 28 '11 at 17:01 2011-05-28 17:01
source share