Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

tildify

sindresorhus9.5mMIT3.0.0TypeScript support: included

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

unexpand, homedir, tilde, tildify, collapse, path, home, directory, user, expand, convert

readme

tildify

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

Install

$ npm install tildify

Usage

import tildify from 'tildify';

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

See untildify for the inverse.