【发布时间】:2016-06-08 02:43:00
【问题描述】:
在python中我可以使用
import os
os.pathsep ===> ':' for unix, ';' for windows.
如何在 nodejs 中获得相同的效果?
现在我在问平台是否是win32
process.platform === 'win32' ? ';' : ':' ;
我想实现与所要求的相同:Python: Platform independent way to modify PATH environment variable 但在 nodejs 中。
【问题讨论】:
-
请使用 os npm 这个nodejs.org/api/os.html
-
os.platform() 是函数
标签: node.js