Convert an absolute path to tilde path: /Users/sindresorhus/dev => ~/dev
JavaScript
95
36 commits
updated Sep 18, 2026
Convert an absolute path to a tilde path:
/Users/sindresorhus/dev→~/dev
$ npm install tildify
import tildify from 'tildify';
tildify('/Users/sindresorhus/dev');
//=> '~/dev'
See untildify for the inverse.
Overall
Maintained
Code review
npm
Latest release
Releases this year
Convert an absolute path to tilde path: /Users/sindresorhus/dev => ~/dev
JavaScript
95
36 commits
updated Sep 18, 2026
Convert an absolute path to a tilde path:
/Users/sindresorhus/dev→~/dev
$ npm install tildify
import tildify from 'tildify';
tildify('/Users/sindresorhus/dev');
//=> '~/dev'
See untildify for the inverse.
Overall
Maintained
Code review
npm
Latest release
Releases this year