Description of the path. delimiter method in node. js, node. jspath
Method description:
Method returns the real path of the platform. Multiple Return paths are separated by ":" or.
Syntax:
Copy codeThe Code is as follows:
Path. delimiter
Because this method belongs to the path module, You need to introduce the path module (var path = require ("path") before use "))
Receiving parameters:
None
Example:
Copy codeThe Code is as follows:
// Example on * nix system:
Console. log (process. env. PATH)
// '/Usr/bin:/usr/sbin:/usr/local/bin'
Process. env. PATH. split (path. delimiter)
// Returns
['/Usr/bin','/bin', '/usr/sbin','/sbin', '/usr/local/bin']
Example on windows:
Console. log (process. env. PATH)
// 'C: \ Windows \ system32; C: \ Windows; C: \ Program Files \ nodejs \'
Process. env. PATH. split (path. delimiter)
// Returns
['C: \ Windows \ system32', 'c: \ Windows', 'c: \ Program Files \ nodejs \ ']