简体   繁体   中英

how to get PATH environment variable separator in nodejs?

in python i can use

  import os
  os.pathsep ===> ':' for unix, ';' for windows. 

how can i get the same in nodejs?

for now i am asking if platform is win32 or not

 process.platform === 'win32' ? ';' : ':' ;

i want to achieve the same as asked : Python: Platform independent way to modify PATH environment variable but in nodejs.

var path      = require('path');
var delimiter = path.delimiter;

See also here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM