# node-homedir

> Get the effective user's homedir.

Latest version **2.0.0** (published 2023-10-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install node-homedir
pnpm add node-homedir
yarn add node-homedir
bun add node-homedir
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; has provenance; high quality score.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2023-10-05 |
| First published | 2016-10-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=16.0.0 |
| Dependencies | 0 |
| Unpacked size | 7.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 9 |
| Author | ngot |
| Maintainers | ngot, fengmk2 |
| Keywords | homedir, effective, node |

## Links

- npm: https://www.npmjs.com/package/node-homedir
- Repository: https://github.com/node-modules/node-homedir
- Homepage: https://github.com/node-modules/node-homedir#readme
- Issues: https://github.com/node-modules/node-homedir/issues
- npm.io page: https://npm.io/package/node-homedir

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2023-10-05
- 1.1.1 — 2018-07-09
- 1.1.0 — 2017-10-12
- 1.0.0 — 2016-11-04
- 0.0.1 — 2016-10-13

## README

# node-homedir

Get the effective user's homedir, if Node.js >= v16.0.0 .

Always return the homedir of the current executor， even execute with `sudo -u [user] node app.js` without `-i`.

[Reference Issue](https://github.com/nodejs/node/issues/5582)

[![NPM version][npm-image]][npm-url]
[![CI](https://github.com/node-modules/node-homedir/actions/workflows/nodejs.yml/badge.svg)](https://github.com/node-modules/node-homedir/actions/workflows/nodejs.yml)
[![Test coverage][codecov-image]][codecov-url]
[![Known Vulnerabilities][snyk-image]][snyk-url]
[![npm download][download-image]][download-url]

[npm-image]: https://img.shields.io/npm/v/node-homedir.svg?style=flat-square
[npm-url]: https://npmjs.org/package/node-homedir
[codecov-image]: https://codecov.io/github/node-modules/node-homedir/coverage.svg?branch=master
[codecov-url]: https://codecov.io/github/node-modules/node-homedir?branch=master
[snyk-image]: https://snyk.io/test/npm/node-homedir/badge.svg?style=flat-square
[snyk-url]: https://snyk.io/test/npm/node-homedir
[download-image]: https://img.shields.io/npm/dm/node-homedir.svg?style=flat-square
[download-url]: https://npmjs.org/package/node-homedir

## Installation

```bash
npm install node-homedir
```

## Usage

Commonjs

```js
const { homedir } = require('node-homedir');

console.log(homedir());
```

ESM & TypeScript

```ts
import { homedir } from 'node-homedir';

console.log(homedir());
```

## License

[MIT](LICENSE)

---
_Source: https://npm.io/package/node-homedir · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
