jashkenas/coffee-script — pull request #2513 by vanviegen (2012-08-27 13:46:34+00:00)
Title: Add 'export' keyword

Prefix assignments with the 'export' keyword, to cause their 'var' definitions to move up one level of scope. The keyword can be repeated to move even higher up in the scope.

The common use-case is probably at the top level scope, where it will allow your variables to be defined outside the top-level function wrapper. For instance, we are concatenating the output of multiple CoffeeScript compiles into UglifyJS, and this allows us to not pollute the window object, while having access to exported symbols without going through an object. Also, Javascript compressors can work with these exports (as long as they don't reach the window object), but will leave object property key uncompressed.

It can be quite convenient in deeper scopes within a file too.

Does this seem useful to anybody else, or are we alone in this?

Please note: This is not meant as an alternative to the 'exports' object de facto standard.