Say I have a file called participant.coffee
, with two classes in it:
class ParticipantData
constructor: (data) ->
# whatever
doSomething:
console.log 'participant data!'
class ParticipantResult
doAnotherThing:
console.log 'participant result!'
module.exports = new ParticipantResult()
Right now I can access ParticipantResult
by using require('.particpantresult')
, but I can't figure out any way to call ParticipantData
's constructor. Is it possible to access ParticipantData
without moving it to it's own file?
return an object with the constructors, then call those:
with the class-using code: