untildify
Convert a tilde path to an absolute path: `~/dev` → `/Users/sindresorhus/dev`
Last updated a year ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install untildify 
SYNC missed versions from official npm registry.

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

Related

See tildify for the inverse.

Current Tags

  • 6.0.0                                ...           latest (a year ago)

11 Versions

  • 6.0.0                                ...           a year ago
  • 5.0.0                                ...           3 years ago
  • 4.0.0                                ...           8 years ago
  • 3.0.3                                ...           9 years ago
  • 3.0.2                                ...           11 years ago
  • 3.0.1                                ...           11 years ago
  • 3.0.0                                ...           11 years ago
  • 2.1.0                                ...           11 years ago
  • 2.0.0                                ...           12 years ago
  • 1.0.0                                ...           12 years ago
  • 0.1.0                                ...           13 years ago
Maintainers (1)
Downloads
Total 32
Today 0
This Week 4
This Month 18
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (4)

© 2010 - cnpmjs.org x YWFE | Home | YWFE