Skip to content

Instantly share code, notes, and snippets.

@mralexgray
Created May 10, 2016 09:34
Show Gist options
  • Select an option

  • Save mralexgray/3c92d77878261b3c35c9f4afb03c8065 to your computer and use it in GitHub Desktop.

Select an option

Save mralexgray/3c92d77878261b3c35c9f4afb03c8065 to your computer and use it in GitHub Desktop.
Simple coffee-script class definition, module export, and example usage.
r = require 'events'
class Hello extends r
greet: () ->
console.log 'hello'
@emit 'greeted'
e = require './exported'
hello = new Hello
hello.on 'greeted', -> console.log 'jice to meet'
hello.greet()
# require("#{__dirname}/hello")
# hello = new Hello()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment