windows-env
Normalized environment variables for Windows XP and up.
example
const env = console // This is true even if you run it with 32-bit Node.jsif envX64 console
exports
All of process.env
uppercased, and:
PROGRAMFILES_X86
:C:\Program Files (x86)
on 64 bit Windows, elseC:\Program Files
PROGRAMFILES_X64
:C:\Program Files
on 64 bit Windows, else undefinedUSERPROFILE
:USERPROFILE
orHOMEDRIVE
+HOMEPATH
LOCALAPPDATA
: this is usuallyUSERPROFILE\AppData\Local
, falls back toUSERPROFILE\Local Settings\Application Data
for Windows XPX64
: true on 64 bit Windows, regardless of node's bitness
install
With npm do:
npm install windows-env
license
MIT © Vincent Weevers