Both \"return the current working directory of the process\".
It seems you can override the value of process.env.PWD<
PWD
is the current working directory when the process is started, but it is constant. process.cwd()
is asking the underlying system for the process's current directory, which can be changed with process.chdir()
. PWD
is also a POSIX environmental variable, which means it won't work on Windows. process.cwd()
on the other hand, will.