Convert an absolute path to a tilde path: /Users/sindresorhus/dev => ~/dev
/Users/sindresorhus/dev
~/dev
$ npm install --save tildify
var tildify = require('tildify'); tildify('/Users/sindresorhus/dev'); //=> ~/dev
See untildify for the inverse.
MIT © Sindre Sorhus