# path-absolute

> Resolves a path to an absolute path. Supports tilde

Latest version **2.0.0** (published 2026-03-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install path-absolute
pnpm add path-absolute
yarn add path-absolute
bun add path-absolute
```

## Health

**Score 65/100 (B)** — status: stable.

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2026-03-11 |
| First published | 2017-09-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=22.13 |
| Dependencies | 0 |
| Unpacked size | 3.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 104 |
| Author | Zoltan Kochan |
| Maintainers | zkochan |
| Keywords | path, absolute, tilde |

## Links

- npm: https://www.npmjs.com/package/path-absolute
- Repository: https://github.com/zkochan/packages/tree/main/path-absolute
- Homepage: https://github.com/zkochan/packages/tree/main/path-absolute#readme
- npm.io page: https://npm.io/package/path-absolute

## 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

- 2.0.0 (latest) — 2026-03-11
- 1.0.1 — 2018-11-28
- 1.0.0 — 2017-09-11
- 0.0.0 — 2017-09-10

## README

# path-absolute

> Resolves a path to an absolute path. Supports tilde

<!--@shields('npm')-->
[![npm version](https://img.shields.io/npm/v/path-absolute.svg)](https://www.npmjs.com/package/path-absolute)
<!--/@-->

## Installation

```sh
<npm|yarn|pnpm> add path-absolute
```

## Usage

```js
const pathAbsolute = require('path-absolute')

pathAbsolute('~/foo')
//> '/home/zkochan/foo'

pathAbsolute('/foo/bar')
//> '/foo/bar'

pathAbsolute('./foo/bar', '/home')
//> '/home/foo/bar'
```

## API

### `pathAbsolute(path, [cwd]): string`

Resolves a path to an absolute path

## License

[MIT](LICENSE) © [Zoltan Kochan](https://www.kochan.io/)

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