Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Documentation for path module changes.

  • Loading branch information...
commit 37add2262a9bc13daa7eadc4f2165f0328c927a6 1 parent 0c16a06
isaacs authored
Showing with 16 additions and 2 deletions.
  1. +16 −2 doc/api.txt
View
18 doc/api.txt
@@ -1539,15 +1539,29 @@ 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"
------------------------------------
+
++path.extname(p)+::
+Return the extension of the path. Everything after the last '.', if there
+is no '.' then it returns an empty string. Examples:
++
+------------------------------------
+node> require("path").extname("index.html")
+".html"
+node> require("path").extname("index")
+""
+------------------------------------
++
+
+path.exists(p, callback)+::
Test whether or not the given path exists. Then, call the +callback+ argument with either true or false. Example:
+
Please sign in to comment.
Something went wrong with that request. Please try again.