0.0.3 • Published 8 years ago

get-windows-env v0.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

get-windows-env

Build Status NPM version Dependency Status License Js Standard Style

Get a list of system or user environment variables on windows.

Why not just process.env?

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.

import {
  getUserEnv,
  getSystemEnv
} from 'get-windows-env'

getSystemEnv().then(registry => console.log(registry))
/* =>
 * [
 *   {
 *     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

License

MIT

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago