Skip to content
This repository has been archived by the owner on Apr 9, 2021. It is now read-only.

Commit

Permalink
add FAQ
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Oct 31, 2015
1 parent 23e6d1e commit c4a7fa2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions readme.md
Expand Up @@ -22,6 +22,13 @@ console.log(userHome);
Returns `null` in the unlikely scenario that the home directory can't be found. Returns `null` in the unlikely scenario that the home directory can't be found.




## FAQ

### Why not just use the `os-home` module?

This module was made long before [`os-homedir`](https://github.com/sindresorhus/os-homedir). When Node.js decided to add a native method for getting the user's home directory, I made a polyfill matching its API and decided to depend on it here, so not to have duplicate code. The main reason this one is still around is that lots of modules depend on it and I see no reason to inconvenience dependents by deprecating this. This one also gets the home directory on startup and returns a string rather than exposing a method, so it's faster, and I prefer this API. [Modules are cheap in Node.js](https://github.com/sindresorhus/ama/issues/10#issuecomment-117766328), so doesn't matter. Use whichever you prefer. I'm going to continue using this one.


## Related ## Related


- [user-home-cli](https://github.com/sindresorhus/user-home-cli) - CLI for this module - [user-home-cli](https://github.com/sindresorhus/user-home-cli) - CLI for this module
Expand Down

0 comments on commit c4a7fa2

Please sign in to comment.