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:
Output:
;
Example 2:
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