title: nodejs __dirname is a dot when I try to execute a script directly in package.json file
body: <p>Here is a chunk of my package.json file:</p>
  
  <pre><code>{
      ...
      "scripts": {
          "run-test": "node -e 'require(`my-test-lib`).whichPath(__dirname )'",
      },
      ...
  }
  </code></pre>
  
  <p>When I read my function param into the 'test' script, it is a simple dot <code>.</code> :-s</p>
  
  <p>I thought that <code>__dirname</code> was always absolute, but it's not the case...</p>
  
  <p>I've used <code>process.cwd()</code> for the moment, but I'm curious why this is not working. Have you got a clue ?</p>
  
  <p>While I was searching, I found <a href="https://stackoverflow.com/questions/40138862/when-dirname-is-not-absolute">this question</a> that is related to the subject and I found relevant, but it has no answer.</p>