简体   繁体   English

如何在nodejs中获取PATH环境变量分隔符?

[英]how to get PATH environment variable separator in nodejs?

in python i can use 在python我可以使用

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

how can i get the same in nodejs? 我怎么能在nodejs中得到相同的东西?

for now i am asking if platform is win32 or not 现在我问平台是不是win32

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

i want to achieve the same as asked : Python: Platform independent way to modify PATH environment variable but in nodejs. 我想实现与要求相同: Python:平台无关的方式修改PATH环境变量但在nodejs。

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

See also here . 另见这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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