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'
Related
See untildify for the inverse.
Convert an absolute path to tilde path: /Users/sindresorhus/dev => ~/dev
Use Git or checkout with SVN using the web URL.
Work fast with our official CLI. Learn more.
If nothing happens, download GitHub Desktop and try again.
If nothing happens, download GitHub Desktop and try again.
If nothing happens, download Xcode and try again.
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Convert an absolute path to tilde path: /Users/sindresorhus/dev => ~/dev