Is this considered good code, is there a cleaner/better way? So the child classes wouldn't know anything about how to actually get data from a storage mechanism. Just be able to use those methods to compose functionality.
base.js
function Base() {}
Base.prototype.getInternal = function(id, cb) {}
module.exports = Base;
child.js
function Child() {}
util.inherits(Child, Base);
Child.prototype.get = function(id, cb) {
this.getInternal(id, cb);
}
module.exports = new Child();
test.js
var Child = require('child');
Child.get('id', function(err, result) {
});
The code looks fine. I like that method of inheritance for Node.js, however you can also check out a piece of code like John Resig's simple inheritance port.
As for looking at the best way to encapsulate the storage method you could do with with dependency injection where you pass in the storage method. This is a decent article about it. http://merrickchristensen.com/articles/javascript-dependency-injection.html
You apply prototypical inheritance successfully. Nothing more to say about it. However, there is also another approach called functional inheritance. Julien Richard-Foy convincingly argues that functional inheritance might be preferable.
In a class-based language like Java you would certainly use inheritance extensively. In the prototype-based language JavaScript, however, it is not common to use inheritance that extensively. (Maybe because many people won't wrap their head around the concept of prototypes or maybe because JavaScript lacks too many additional features you would expect from an object-oriented language. I can't say.) Instead of using language features JavaScript developers often resort to design patterns like adapters, decorators, and proxies.
One really important design pattern is dependency injection. As Charlie Key already said this pattern might be the better alternative to inheritance in your case. If you want to look into using dependency injection in node.js read this excellent article or check out Fire Up! - a dependency injector I implemented.