package
Normalized environment variables for Windows XP and up
npm install windows-envGitHub-flavored package documentation.
Across all versions, last 30 days.
14,242 in 30 days
Runtime metadata.
Tagged topics.
Normalized environment variables for Windows XP and up.
const env = require('windows-env')
console.log('32-bit Program Files: %s', env.PROGRAMFILES_X86)
// This is true even if you run it with 32-bit Node.js
if (env.X64) {
console.log('64-bit Program Files: %s', env.PROGRAMFILES_X64)
}All of process.env uppercased, and:
PROGRAMFILES_X86: C:\Program Files (x86) on 64 bit Windows, else C:\Program FilesPROGRAMFILES_X64: C:\Program Files on 64 bit Windows, else undefinedUSERPROFILE: USERPROFILE or HOMEDRIVE + HOMEPATHLOCALAPPDATA: this is usually USERPROFILE\AppData\Local, falls back to USERPROFILE\Local Settings\Application Data for Windows XPX64: true on 64 bit Windows, regardless of node's bitnessWith npm do:
npm install windows-envMIT © Vincent Weevers