Node.js path.delimiter Property Last Updated : 11 Oct, 2021 Comments Improve Suggest changes Like Article Like Report 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: This property returns a string that represents platform specific path delimiter. The returned value is : for POSIX and ; for Windows. Below examples illustrate the use of path.delimiter in Node.js: Example 1: javascript // Node.js program to demonstrate the // path.delimiter property // Allocating path module const path = require('path'); // Printing path.delimiter value console.log(path.delimiter); Output: ; Example 2: javascript // Node.js program to demonstrate the // path.delimiter property // Allocating path module const path = require('path'); // Allocating process module const process = require('process'); // Printing path.delimiter value var delimiter = path.delimiter; console.log(process.env.PATH); console.log(process.env.PATH.split(path.delimiter)); Output: C:\wamp64\bin\php\php7.3.1\ext\ImageMagick;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows; C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\; C:\Windows\System32\OpenSSH\;D:\programfiles\Git\cmd; D:\programfiles\Cmake\bin; C:\Program Files\nodejs\;C:\Users\gekcho\AppData\Local\Microsoft\WindowsApps; C:\Users\gekcho\AppData\Roaming\npm [ 'C:\\wamp64\\bin\\php\\php7.3.1\\ext\\ImageMagick', 'C:\\Program Files (x86)\\Common Files\\Oracle\\Java\\javapath', 'C:\\Windows\\system32', 'C:\\Windows', 'C:\\Windows\\System32\\Wbem', 'C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\', 'C:\\Windows\\System32\\OpenSSH\\', 'D:\\programfiles\\Git\\cmd', 'D:\\programfiles\\Cmake\\bin', 'C:\\Program Files\\nodejs\\', 'C:\\Users\\gekcho\\AppData\\Local\\Microsoft\\WindowsApps', 'C:\\Users\\gekcho\\AppData\\Roaming\\npm' ] Note: The above program will compile and run by using the node filename.js command. Reference: https://nodejs.org/api/path.html#path_path_delimiter Comment More infoAdvertise with us G gekcho Follow Improve Article Tags : Web Technologies Node.js Node.js-path-module Similar Reads Node.js path.basename() Method 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 method. Syntax: path.basename( path, extension ) Parameters: This method accepts two parameters as mentioned above and described below: path: It is the 1 min read Node.js path.dirname() Method 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 ) Parameters: This function accepts one parameter as mentioned above and described below: path: It is the file path that would 1 min read Node.js path.extname() Method 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 (.) in the path to the end of the path string. If there are no periods in the file path, then an empty string is returned. Syntax: path.extname( path ) Pa 2 min read Node.js path.format() Method 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 more priority over another: The "root" parameter of the path object is ignored if the "dir" parameter is provided. The "ext" and "name" parameter of the path ob 3 min read Node.js path.isAbsolute() Method 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 that contains the complete details needed to locate a file. Syntax: path.isAbsolute( path ) Parameters: This method accepts single parameter path which holds the fil 1 min read Node.js path.join() Method The path.join() method in Node.js is part of the Path module, which is used for handling and transforming file paths. The method is used to join multiple path segments together into one complete path, ensuring that the resulting path is formatted correctly for the current operating system. In this a 2 min read Node.js path.normalize() Method The path.normalize() method is used to normalize the given path. Normalization resolves the (.) and (..) segments of the path to their correct form. If the method encounters multiple path separators, it replaces all of them by a single platform-specific path separator. This method preserves all trai 1 min read Node.js path.parse() Method The path.parse() method is used to return an object whose properties represent the given path. This method returns the following properties: root (root name) dir (directory name) base (filename with extension) ext (only extension) name (only filename) The values of these properties may be different 2 min read Node.js path.relative() Method 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 the given paths are the same, it would resolve to a zero-length string. Syntax: path.relative( from, to ) Parameters: This method accept two parameters as me 1 min read Node path.resolve() Method The path.resolve() method takes a sequence of paths or path segments and resolves them into an absolute path. It processes the paths from right to left and appends each path until an absolute path is constructed.Node path.resolve method The path.resolve() method in Node.js helps create a full, absol 3 min read Like