On Coffeescript.org:
bawbag = (x, y) ->
z = (x * y)
bawbag(5, 10)
would compile to:
var bawbag;
bawbag = function(
Since coffeescript is rarely used on it's own, you can use global
variable supplied by either node.js or browserify (and any descendants like coffeeify, gulp build scripts, etc).
In node.js global
is global namespace.
In browserify global
is equal to window
.
So, just:
somefunc = ->
global.variable = 123