From the node manual I see that I can get the directory of a file with __dirname, but from the REPL this seems to be undefined. Is this a misunderstanding on my
__dirname
Seems like you could also do this:
__dirname=fs.realpathSync('.');
of course, dont forget fs=require('fs')
fs=require('fs')
(it's not really global in node scripts exactly, its just defined on the module level)