In a Node.js module I would like to open a file--i.e, with fs.readFile()
--that is contained in the same directory as my module. By which I mean it is in the same directory as the ./node_modules/<module_name>/index.js
file.
It looks like all relative path operations which are performed by the fs
module take place relative to the directory in which Node.js is started. As such, I think I need to know how to get the path of the current Node.js module which is executing.
Thanks.