code: function tilda(cwd) {
    if (cwd.substring(0, 1) === '~') {
      cwd = (process.env.HOME || process.env.HOMEPATH || process.env.HOMEDIR || process.cwd()) + cwd.substr(1);
    }
    return path.resolve(cwd);
  }
docs: path doesnt handle ~ resolution, fallback to env variables, solution taken from https://github.com/nodejs/node-v0.x-archive/issues/2857