I'm trying to get a better understanding of how node works and for this reason I changed /usr/lib/nodejs/fs.js, the change did not appear to be working as expected, so I added throw "fasd"; process.exit(); to the beginning of fs.js, expecting every other script requiring that module to crash, but it does not happen: require('fs'); console.log("i don't care"); prints that line successfully.
My OS is Ubuntu 12.04, dpkg -L nodejs | grep fs.js$ does not show any other file, I tried searching for fs.js in /usr, but did not find another fs.js either.
I do realise that changing core files is a no-no, and I'll revert the changes later, but for now I'm trying to find out why my changes are ignored?
Apparently core modules, such as fs are compiled into binary, so I resorted to copying the file and requiring it with require('./fs').