For the sake of an example, here's something contrived:
var util = require('util');
var Me = require('./me.js');
console.log(util.inspect(Me.prototype.something.toString())); // #1
Me.prototype.name = function() {
console.log('different');
};
console.log(util.inspect(Me.prototype.something.toString())); // #2
// re-init prototype
var Me = require('./me.js');
console.log(util.inspect(Me.prototype.something.toString())); // #3
Output:
'function () {\n console.log(\'original\');\n}'
'function () {\n console.log(\'different\');\n}'
'function () {\n console.log(\'different\');\n}'
Why doesn't the require
call re-init Me class prototype?