Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Get home directory path on any platform
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore Add optional sub directory to home path
LICENSE license: MIT
README.md Update readme
index.js Add optional sub directory to home path
package.json license: MIT

README.md

home-dir

Get home directory path on any platform

Install

npm install home-dir --save

Usage

var homeDir = require('home-dir');

console.log(homeDir()); // Outputs full path to your home directory

// OR

var dir = homeDir('/path/to/somehwere');
console.log(dir) // OUTPUTS: /(HOME)/path/to/somewhere

// OR

var homeDir = require('home-dir').directory;
Something went wrong with that request. Please try again.