diff --git a/doc/api.txt b/doc/api.txt index ea814f3b5b..0a04451b9d 100644 --- a/doc/api.txt +++ b/doc/api.txt @@ -1539,11 +1539,13 @@ node> require("path").dirname("/foo/bar/baz/asdf/quux") ------------------------------------ + -+path.filename(p)+:: ++path.basename(p, ext)+:: Return the last portion of a path. Similar to the Unix +basename+ command. Example: + ------------------------------------ -node> require("path").filename("/foo/bar/baz/asdf/quux") +node> require("path").filename("/foo/bar/baz/asdf/quux.html") +"quux.html" +node> require("path").filename("/foo/bar/baz/asdf/quux.html", ".html") "quux" ------------------------------------ +