windows-env

2019-02-13 admin

windows-env是什么

什么是windows-env,Normalized environment variables for Windows XP and up

windows-env使用教程帮助文档

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

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-53660.html

文章标题:windows-env

回到顶部