title: Javascript: Check if url is real file or symlink
body: <p>I need the equivalent of PHP function <code>is_link()</code> in Javascript.</p>
  
  <p>I have a directory with a mix of files and symlinks:</p>
  
  <pre><code>lrwxrwxrwx 1 www-data www-data   30 Aug 31 11:14 AD164_RNA_1.fq.gz -&gt; ../../shared/AD164_RNA_1.fq.gz
  lrwxrwxrwx 1 www-data www-data   30 Aug 31 11:14 AD164_RNA_2.fq.gz -&gt; ../../shared/AD164_RNA_2.fq.gz
  lrwxrwxrwx 1 www-data www-data   33 Aug 31 11:14 CD34_2_1.clean.fq.gz -&gt; ../../shared/CD34_2_1.clean.fq.gz
  lrwxrwxrwx 1 www-data www-data   29 Aug 31 11:14 HL60_RNA_1.fq.gz -&gt; ../../shared/HL60_RNA_1.fq.gz
  lrwxrwxrwx 1 www-data www-data   29 Aug 31 11:14 HL60_RNA_2.fq.gz -&gt; ../../shared/HL60_RNA_2.fq.gz
  -rw-r--r-- 1 www-data www-data 7.4G Aug 10 16:19 NT07_NT_DNA_1.fq.gz
  -rw-r--r-- 1 www-data www-data 7.6G Aug 10 16:18 NT07_NT_DNA_2.fq.gz
  -rw-r--r-- 1 www-data www-data 7.0G Aug 10 16:18 NT07_TP_DNA_1.fq.gz
  -rw-r--r-- 1 www-data www-data 7.2G Aug 10 16:20 NT07_TP_DNA_2.fq.gz
  -rw-r--r-- 1 www-data www-data 284M Aug 23 14:17 RHH3901_1.fq.gz
  -rw-r--r-- 1 www-data www-data 276M Aug 31 10:27 RHH3902_1.fq.gz
  -rw-r--r-- 1 www-data www-data  99M Aug 31 10:27 RHH3903_1.fq.gz
  -rw-r--r-- 1 www-data www-data  88M Aug 31 10:58 RHH3903_1.trimmed.fq.gz
  </code></pre>
  
  <p>How can I check if the url to the files in this directory is a real file or symlink something like:</p>
  
  <pre><code>if ('mydir/NT07_TP_DNA_2.fq.gz' is file) {
      // do file stuff
  } else if ('mydir/NT07_TP_DNA_2.fq.gz' is symlink) {
      // do symlink stuff
  } else {
      // do other stuff
  }
  </code></pre>
  
  <p>using <strong>Javascript/JQuery</strong>?</p>