3

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.

Community
  • 1
  • 1
guy mograbi
  • 22,955
  • 13
  • 75
  • 115

1 Answers1

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

See also here.

robertklep
  • 174,329
  • 29
  • 336
  • 330