JSPM

windows-env

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 900
  • Score
    100M100P100Q101347F
  • License MIT

Normalized environment variables for Windows XP and up

Package Exports

  • windows-env

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (windows-env) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

windows-env

Normalized environment variables for Windows XP and up.

npm status Build status Dependency status

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, else C:\Program Files
  • PROGRAMFILES_X64: C:\Program Files on 64 bit Windows, else undefined
  • USERPROFILE: USERPROFILE or HOMEDRIVE + HOMEPATH
  • LOCALAPPDATA: this is usually USERPROFILE\AppData\Local, falls back to USERPROFILE\Local Settings\Application Data for Windows XP
  • X64: true on 64 bit Windows, regardless of node's bitness

install

With npm do:

npm install windows-env

license

MIT © Vincent Weevers