sindresorhus/untildify

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

JavaScript

148

37 commits

updated Sep 18, 2026

See the code

README

untildify

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

Install

npm install untildify

Usage

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

See tildify for the inverse.

sindresorhus/untildify

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

JavaScript

148

37 commits

updated Sep 18, 2026

See the code

README

untildify

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

Install

npm install untildify

Usage

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

See tildify for the inverse.

Project health

Overall

3.6/10

Maintained

0/10

Code review

2/10
OpenSSF Scorecard

Latest release

6.0.0 · Sep 9, 2025

Releases this year

0