UNPKG

735 BMarkdownView Raw
1# os-homedir [![Build Status](https://travis-ci.org/sindresorhus/os-homedir.svg?branch=master)](https://travis-ci.org/sindresorhus/os-homedir)
2
3> Node.js 4 [`os.homedir()`](https://nodejs.org/api/os.html#os_os_homedir) [ponyfill](https://ponyfill.com)
4
5
6## Install
7
8```
9$ npm install --save os-homedir
10```
11
12
13## Usage
14
15```js
16const osHomedir = require('os-homedir');
17
18console.log(osHomedir());
19//=> '/Users/sindresorhus'
20```
21
22
23## Related
24
25- [user-home](https://github.com/sindresorhus/user-home) - Same as this module but caches the result
26- [home-or-tmp](https://github.com/sindresorhus/home-or-tmp) - Get the user home directory with fallback to the system temp directory
27
28
29## License
30
31MIT © [Sindre Sorhus](https://sindresorhus.com)