Typical directory locations are OS-specific.
The main temporary directory could for example be:
/tmp
on Linux./var/folders/.../T
on Mac.C:\Users\USER\AppData\Local\Temp
on Windows.
os.tmpdir()
can be used to
retrieve it on any OS.
Different terminal sessions on the same machine might have different temporary directories on Windows.
The user's home directory could for example be:
/home/USER
on Linux./Users/USER
on Mac.C:\Users\USER
on Windows.
os.homedir()
can be used to
retrieve it on any OS.
Application-specific settings are stored into
subdirectories on Windows:
Roaming
(APPDATA
environment variable) and Local
(LOCALAPPDATA
environment variable).
This is also OS-specific.
global-cache-dir
can be used to
retrieve it on any OS.
This is /dev/null
on Unix and \\.\nul
on Windows.
os.devNull
can be used to
retrieve it on any OS.
env-paths
can be used to retrieve
other common directories for logging, configuration or application data on any
OS.
Man pages are Unix-specific so the
package.json
's man
field
does not have any effects on Windows.
Use os.tmpdir()
,
os.homedir()
,
global-cache-dir
and
env-paths
.