📜  path.basename nodejs - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:56.188000             🧑  作者: Mango

代码示例1
/* The path.basename() method returns the last portion of a path,
similar to the Unix basename command. Trailing directory separators
are ignored, see path.sep. */

path.basename('/foo/bar/baz/asdf/quux.html');
// Returns: 'quux.html'

path.basename('/foo/bar/baz/asdf/quux.html', '.html');
// Returns: 'quux'