Reproducing Node Circular dependcy with ES6 Class
Based on
https://coderwall.com/p/myzvmg/circular-dependencies-in-node-js
https://gist.github.com/lperrin/5934098
https://nodejs.org/api/modules.html#modules_cycles
node index.js
will see an error TypeError: moduleA is not a constructor
class ModuleA {
}
module.exports = ModuleA;
var moduleB = require('./b');
ModuleA.prototype.hello = function(){
console.log('hello!');
}