path.basename nodejs code example
Example: path.basename nodejs
/* 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'