Skip to content

Instantly share code, notes, and snippets.

@benshimmin
Created August 13, 2012 16:09
Show Gist options
  • Save benshimmin/3342231 to your computer and use it in GitHub Desktop.
Save benshimmin/3342231 to your computer and use it in GitHub Desktop.
CoffeeScript classes and Node.js
class ApplicationBase
constructor : (arg1, arg2) ->
# do something with arg1, arg2
@init()
init : => # override this
module.exports = ApplicationBase
ApplicationBase = require "#{__dirname}/base"
class Main extends ApplicationBase
constructor : (arg1, arg2) -> super arg1, arg2
init : => # overrides base init function
module.exports = Main
Main = require "#{__dirname}/main"
new Main "arg1", "arg2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment