I found this snippet on the Coffeescript FAQ for creating simplistic namespaces ..
# Code:
#
namespace = (target, name, block) ->
[target, name, block]
The trick is to create the class first
class MyFirstClass
myFunc: () ->
console.log 'works'
class MySecondClass
constructor: (@options = {}) ->
myFunc: () ->
console.log 'works too'
console.log @options
Then somewhere near the end of the file export all the classes than need to be exposed.
namespace "Project.Something", (exports) ->
exports.MyFirstClass = MyFirstClass
exports.MySecondClass = MySecondClass
Later on you can use the classes as so:
var firstClass = new Project.Something.MyFirstClass()
firstClass.myFunc()
var secondClass = new Project.Something.MySecondClass
someVar: 'Hello World!'
secondClass.myFunc()