1.0.1 • Published 10 years ago
windows-env v1.0.1
windows-env
Normalized environment variables for Windows XP and up.
example
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)
}exports
All of process.env uppercased, and:
PROGRAMFILES_X86:C:\Program Files (x86)on 64 bit Windows, elseC:\Program FilesPROGRAMFILES_X64:C:\Program Fileson 64 bit Windows, else undefinedUSERPROFILE:USERPROFILEorHOMEDRIVE+HOMEPATHLOCALAPPDATA: this is usuallyUSERPROFILE\AppData\Local, falls back toUSERPROFILE\Local Settings\Application Datafor Windows XPX64: true on 64 bit Windows, regardless of node's bitness
install
With npm do:
npm install windows-envlicense
MIT © Vincent Weevers