Resolving circular dependencies with Node.js require and classes in CoffeeScript
I want to know if there is a way to idiomatically avoid issues with circular dependencies with Node.js's require while using CoffeeScript classes and super . Given the following simplified CoffeeScript files: a.coffee: C = require './c' B = require './b' class A extends C b: B someMethod: -> super module.exports = A b.coffee: C = require './c' A = require './a' class B extends C a: A someMethod: -> super module.exports = B The first obvious issue here is that there is a circular dependency between A and B. Whichever one evaluates first will have {} as a reference to the other. To resolve this