I am trying to achieve something like following in Node.js and Express.js, not able to find good examples of active this. Help appreciated.
base.js
--------
module.exports = {
baseFunction: function(){
.....
}
}
child.js
--------
module.exports = {
require('base'),
***** Some Magical Code ******
childFunction: function(){
.....
}
}
CallProgram.js
--------------
var child = require('child');
child.baseFunction();
require('base');in child programs which will enable access to base methods without having to duplicating the code. I might override the code some child classes if required. Hope this makes sense.