tildify
v3.0.0 unexpand homedir tilde tildify collapse path home directory user and 3 more...
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.
npm i tildify
Metadata
- MIT
- ^12.20.0 || ^14.13.1 || >=16.0.0
- Sindre Sorhus
- released 8/12/2021