get-windows-env
Get a list of system or user environment variables on windows.
process.env
?
Why not just If you want to differentiate between user and system variables this package is for you. Otherwise process.env
works just fine.
Example
See test/index.js for full examples.
/* => * [ * { * name: 'TEMP', * type: 'REG_EXPAND_SZ', * path: '%USERPROFILE%\\AppData\\Local\\Temp' * }, * { * name: 'TMP', * type: 'REG_EXPAND_SZ', * path: '%USERPROFILE%\\AppData\\Local\\Temp' * }, * * ... * ] */
API
#getUserEnv()
Gets all user environment variables.
#getSystemEnv()
Gets all system environment variables.
#queryRegistry(key)
Given a registry key, it returns you a matching that path.
#parseRegistry(stdout::String)
Parses a given registry string from the queryRegistry()
function to a set of key value pairs { name, type, path }
.
#keys
Object containing { user, system }
registry keys for querying the windows registry.
Tests
$ npm test