https://github.com/sindresorhus/os-homedir
[DEPRECATED] Node.js `os.homedir()` ponyfill
https://github.com/sindresorhus/os-homedir
deprecated homedir javascript nodejs ponyfill
Last synced: 2 months ago
JSON representation
[DEPRECATED] Node.js `os.homedir()` ponyfill
- Host: GitHub
- URL: https://github.com/sindresorhus/os-homedir
- Owner: sindresorhus
- License: mit
- Archived: true
- Created: 2015-05-11T12:04:43.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2021-01-24T06:12:50.000Z (almost 5 years ago)
- Last Synced: 2025-09-11T02:26:22.651Z (3 months ago)
- Topics: deprecated, homedir, javascript, nodejs, ponyfill
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 61
- Watchers: 7
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/funding.yml
- License: license
- Security: .github/security.md
Awesome Lists containing this project
- awesome-nodejs-precise - os-homedir - homedir .svg?style=social&label=Star&maxAge=2592000?style=flat-square)]() | Node.js 4 <code>os.homedir()</code> ponyfill. | (Packages / Polyfills Node.js)
- awesome-nodejs-cn - os-homedir - Node.js 4.0 `os.homedir()` ponyfill. (Number / Polyfills)
README
# Deprecated
This is not needed anymore. Use `require('os').homedir()` instead.
---
# os-homedir [](https://travis-ci.org/sindresorhus/os-homedir)
> Node.js 4 [`os.homedir()`](https://nodejs.org/api/os.html#os_os_homedir) [ponyfill](https://ponyfill.com)
## Install
```
$ npm install --save os-homedir
```
## Usage
```js
const osHomedir = require('os-homedir');
console.log(osHomedir());
//=> '/Users/sindresorhus'
```
## Related
- [user-home](https://github.com/sindresorhus/user-home) - Same as this module but caches the result
- [home-or-tmp](https://github.com/sindresorhus/home-or-tmp) - Get the user home directory with fallback to the system temp directory
---
Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.