I've been sitting here for 3 hours straight, trying to figure out how I could possibly export a class from one file, require it (multiple times) in other files, so that that class can be extended.
My current code looks something like this:
// base.js //
class Base {
constructor() { ... }
}
exports = Base;
// extension.js //
var Base = require('./base.js');
class Extension extends Base {
constructor() { ... }
}
I get an Exception telling me that 'Base' is not a constructor. When I run console.log(Base), I get an empty object. Am I doing something completely wrong, or is my desire not possible?
I'd be glad for any help given!