title: Getting directory from which node.js was executed
body: <p>I have some project, and I run it with <code>node main.js</code> / <code>make test</code> etc. What I need is to get this directory from a script. Not only from <code>main.js</code>, but also from any submodule. I tried with <code>path</code> plugin and <code>__directory</code>, but I get a path of the current file (for example submodule). I also tried <code>require('path').dirname(require.main.filename)</code>, but when I run <code>make test</code> I get mocha dirname instead of my project directory. What is the easiest way to solve this?</p>