NodeJS - convert relative path to absolute : <p>In my <em>File-system</em> my working directory is here:</p>

<p><strong>C:\temp\a\b\c\d</strong></p>

<p>and under b\bb there's file: tmp.txt</p>

<p><strong>C:\temp\a\b\bb\tmp.txt</strong></p>

<p>If I want to go to this file from my working directory, I'll use this path:</p>

<pre><code>"../../bb/tmp.txt"
</code></pre>

<p>In case the file is not exist I want to log the full path and tell the user:<br>
<strong>"The file C:\temp\a\b\bb\tmp.txt is not exist"</strong>. </p>

<p><strong>My question:</strong></p>

<p>I need some <strong>function</strong> that <em>convert</em> the relative path: "../../bb/tmp.txt" to absolute: "C:\temp\a\b\bb\tmp.txt" </p>

<p>In my code it should be like this:   </p>

<pre><code>console.log("The file" + convertToAbs("../../bb/tmp.txt") + " is not exist")
</code></pre>
