title: Get file name from absolute path in Nodejs?
body: <p>How can I get the file name from an absolute path in Nodejs?</p>
  <p>e.g. <code>&quot;foo.txt&quot;</code> from <code>&quot;/var/www/foo.txt&quot;</code></p>
  <p>I know it works with a string operation, like <code>fullpath.replace(/.+\//, '')</code>,
  but I want to know is there an explicit way, like <code>file.getName()</code> in Java?</p>