title: Get filepath/name of a File Descriptor in node.js
body: <p>How do you get fullpath <strong>from a file descriptor</strong> in node?</p>
  
  <pre><code>var fs = require('fs')
  var fd = fs.openSync('package.json', 'r')
  
  console.log(fd) // 10
  
  console.log(get_file_path_from_fd(fd)) // HELP
  </code></pre>
  
  <p>Edit: I have found <a href="https://coderwall.com/p/llunqa/get-path-of-a-file-descriptor-in-linux-in-node-js" rel="nofollow noreferrer">this</a></p>
  
  <pre><code>&gt; fs.openSync('.', 'r')
  10
  &gt; fs.readlinkSync('/proc/self/fd/10')
  '/home/alfred/repos/test
  </code></pre>
  
  <p>but i didn't find proc folder in Mac</p>