# homedir > Return the current user's home directory.
## Usage ```javascript var homedir = require( '@stdlib/os/homedir' ); ``` #### homedir() Returns the current user's `home` directory. ```javascript var home = homedir(); // e.g., returns '/Users/' ``` If unable to locate a `home` directory, the function returns `null`.
## Notes - The implementation primarily checks various [environment variables][environment-variables] to locate a `home` directory. Note that this approach has **security vulnerabilities**, as attackers can tamper with [environment variables][environment-variables].
## Examples ```javascript var homedir = require( '@stdlib/os/homedir' ); console.log( homedir() ); ```
* * *
## CLI
### Usage ```text Usage: homedir [options] Options: -h, --help Print this message. -V, --version Print the package version. ```
### Examples ```bash $ homedir e.g., /Users/ ```