Replace user home in a string with another string. Useful for tildifying a path.
var replaceHomedir = ;var shortPath = ;// shortPath === '~/myProject'
Takes a string
path as the first argument and a string or function
replacement as the second argument. If the
path is absolute and begins with the User's homedir, the homedir portion of the path is replaced with
replacement using String#replace.
path is not a string, the function will throw.