nodejs从绝对path获取文件名?
如果有任何API可以从绝对文件path中检索文件名?
例如"/var/www/foo.txt" "foo.txt" "/var/www/foo.txt" 
 我知道它适用于string操作,就像fullpath.replace(/.+\//, '')但我想知道是否有一个更正式的方式,像java中的file.getName()可以做到这一点。 
NodeJS从绝对path获取文件名?
 使用path模块的basename方法: 
 path.basename('/foo/bar/baz/asdf/quux.html') // returns 'quux.html' 
以上是从上面的例子中获取的文档。