Node.js - Path module
The Path module of Node.js offers utilities for working with file and directory paths. Depending on the type of operating system − POSIX or WINDOWS, the methods given in the Path module may yield varying results.
List of Methods
Following is a list of methods available in the Path Module −
| Sr.No | Module & Description |
|---|---|
| 1 |
This function allows you to retrieve last portion of a specified path. |
| 2 |
It is a platform-specific property, it represents the delimiter (separator) used to separate the file paths in the environment variable named PATH of the current operating system. |
| 3 |
This method is used to retrieve the parent directory for a specified path. |
| 4 |
Used to get the extension of the given file, based on the last occurrence of the (.) period character in the path. |
| 5 |
This method accepts an object representing a path and returns the given path in the string format. |
| 6 |
It will return a Boolean value, which is used to determine whether the given path is absolute or not. |
| 7 |
Used to join all the given string path segments together by using the platform separator. |
| 8 |
It is used to normalize the given path. |
| 9 |
It returns an object whose properties represent significant elements of a path. |
| 10 |
It is used to retrieve a relative path from one path to another path based on current working directory. |
| 11 |
It is used to rectify a series of path segments or paths to an absolute path. |
| 12 |
It returns an equivalent namespace-prefixed path for the given path. |