untildify
Convert a tilde path to an absolute path: `~/dev` → `/Users/sindresorhus/dev`
Last updated 7 months ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm 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 (7 months ago)

11 Versions

  • 6.0.0                                ...           7 months ago
  • 5.0.0                                ...           3 years ago
  • 4.0.0                                ...           7 years ago
  • 3.0.3                                ...           8 years ago
  • 3.0.2                                ...           10 years ago
  • 3.0.1                                ...           10 years ago
  • 3.0.0                                ...           10 years ago
  • 2.1.0                                ...           11 years ago
  • 2.0.0                                ...           11 years ago
  • 1.0.0                                ...           12 years ago
  • 0.1.0                                ...           12 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (4)

Copyright 2013 - present © cnpmjs.org | Home |