title: fs in Node.js Doesn't Understand ~/
body: <p>I'm trying to check if a directory exists as part of a command-line app in node.js. However, <code>fs</code> doesn't seem to understand <code>~/</code>. For example, the following returns false...</p>
  
  <pre><code>&gt; fs.existsSync('~/Documents')
  false
  </code></pre>
  
  <p>...but this returns true...</p>
  
  <pre><code>&gt; fs.existsSync('/Users/gtmtg/Documents')
  true
  </code></pre>
  
  <p>...even though they're both the same thing.</p>
  
  <p>Why does this happen, and is there are workaround for this? Thanks in advance!</p>