# untildify

> Convert a tilde path to an absolute path: `~/dev` → `/Users/sindresorhus/dev`

Latest version **6.0.0** (published 2025-09-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install untildify
pnpm add untildify
yarn add untildify
bun add untildify
```

## Health

**Score 60/100 (C)** — status: stable.

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 6.0.0 |
| Published | 2025-09-09 |
| First published | 2014-04-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=20 |
| Dependencies | 0 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 148 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | tilde, expansion, expand, untildify, path, home, directory, user, shell, bash |

## Links

- npm: https://www.npmjs.com/package/untildify
- Repository: https://github.com/sindresorhus/untildify
- Homepage: https://github.com/sindresorhus/untildify#readme
- Issues: https://github.com/sindresorhus/untildify/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/untildify

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 6.0.0 (latest) — 2025-09-09
- 5.0.0 — 2023-06-11
- 4.0.0 — 2019-04-29
- 3.0.3 — 2018-05-19
- 3.0.2 — 2016-05-07
- 3.0.1 — 2016-04-30
- 3.0.0 — 2016-04-27
- 2.1.0 — 2015-06-13
- 2.0.0 — 2015-02-02
- 1.0.0 — 2014-08-03
- 0.1.0 — 2014-04-19

## README

# untildify

> Convert a tilde path to an absolute path: `~/dev` → `/Users/sindresorhus/dev`

## Install

```sh
npm install untildify
```

## Usage

```js
import untildify from 'untildify';

untildify('~/dev');
//=> '/Users/sindresorhus/dev'

// Assuming the current user is 'sindresorhus'
untildify('~sindresorhus/dev');
//=> '/Users/sindresorhus/dev'
```

## Features

- Expands `~` to the current user's home directory
- Expands `~username` to the home directory when username matches the current user
- Returns path unchanged if username doesn't match the current user

## Related

See [tildify](https://github.com/sindresorhus/tildify) for the inverse.

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