Given two modules a and b. I know that it is possible to expose a's functionality to another module using the module.exports. I probably do not use it correctly.
a.js
function A() { ... }
A.prototype.func = function() { ... }
function test() {
new A().func();
}
test();
module.exports = {
A : new A()
};
The test() is working correctly. But the following breaks:
b.js
var A = require("./a");
A.func(); //throws an exception
How do I export the whole A module with its functionality?
Update: executing console.log(A) over b (as a second line), does not reveal any of A's methods and variables.
A, tryObject.keys(A).