New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

userinfo

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

userinfo

cross platform user info

latest
Source
npmnpm
Version
1.2.1
Version published
Maintainers
2
Created
Source

userinfo

Current Version Build Status via Travis CI Dependencies devDependencies

Node.js native addon for working with user information

Methods

whoami()

  • Arguments
    • None
  • Returns
    • string - The current username.

Returns the current username. Calls GetUserName() on Windows, and getlogin_r() otherwise. Throws if the username cannot be retrieved.

getHomeDirectory()

Deprecated - As of Node/io.js v2.3.0, os.homedir() provides this functionality.

  • Arguments
    • None
  • Returns
    • string - The current user's home directory.

Returns the current user's home directory. Calls SHGetKnownFolderPath() on Windows, and getlogin_r() followed by getpwnam() otherwise. Throws if the home directory cannot be retrieved. Currently, only the current user's home directory can be retrieved, due to Windows limitations.

Command Line Interface (CLI)

userinfo functionality can be accessed via the command line. The CLI is available using the userinfo command. The following command line arguments are valid:

  • w, whoami - Invokes whoami()
  • H, getHomeDirectory - Invokes getHomeDirectory()

Keywords

whoami

FAQs

Package last updated on 23 Oct 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts