How to deal with cyclic dependencies in Node.js

I’ve been working with nodejs lately and still getting to grips with the module system so apologies if this is an obvious question. I want code roughly like the following below: a.js (the main file run with node) var ClassB = require(“./b”); var ClassA = function() { this.thing = new ClassB(); this.property = 5; } … Read more