Skip to content

Tag Archives: Node.js-path-module

The Path Module in Node.js provides the utilities for working with file and directory paths. Example: Javascript // Import the path module const path =… Read More
The path.format() method is used to return a path string from the given path object. The method has some rules where one path property gets… Read More
The path.toNamespacedPath() method is used to find the equivalent namespace-prefixed path from the given path. This method is meaningful only on Windows Systems. It would… Read More
The path.delimiter property is an inbuilt application programming interface of the path module which is used to get platform-specific path delimiter. Syntax: path.delimiter; Return Value:… Read More
The path.resolve() method is used to resolve a sequence of path-segments to an absolute path. It works by processing the sequence of paths from right… Read More
The path.join() method is used to join a number of path-segments using the platform-specific delimiter to form a single path. The final path is normalized… Read More
The path.extname() method is used to get the extension portion of a file path. The extension string returned from the last occurrence of a period… Read More
The path.isAbsolute() method is used to check whether the given path is an absolute path or not. An absolute path is defined as a path… Read More
The path.dirname() method is used to get the directory name of the given path. It ignores the respective platform’s trailing directory separators. Syntax: path.dirname( path… Read More
The path.relative() method is used to find the relative path from a given path to another path based on the current working directory. If both… Read More
The path.basename() method is used to get the filename portion of a path to the file. The trailing directory separators are ignored when using this… Read More