homedir-current

1.0.0 • Public • Published

homedir-current

This is a wrapper analagous to the module homedir

Uses passwd-darwin for more support on unix-based platforms.

Install using

npm install --save homedir-current

Usage

The module exports a single function, similar to homedir, but the function takes options and a callback in the form homedir([options,] callback).

Get the current running user's homedir

var homedir = require('homedir-current');
homedir(console.log); // => As root this prints `/var/root`

Sometimes you want to run a process as root for some reason, but put files into the home directory of the running user, to make this simple there is an option for checking for sudo'd commands.

var homedir = require('homedir-current');
homedir({sudo: true}, console.log); // => Prints the directory of the user who ran the command as sudo

License

ISC

Readme

Keywords

Package Sidebar

Install

npm i homedir-current

Weekly Downloads

1

Version

1.0.0

License

ISC

Last publish

Collaborators

  • jackatbancast