expand-home-dir

Expand ~/

Expand ~/

expandHomeDir = require('expand-home-dir')
 
expandHomeDir('~')
// => /Users/azer 
 
expandHomeDir('~/foo/bar/qux.corge')
// => /Users/azer/foo/bar/qux.corge 
$ npm install expand-home-dir