This is not needed anymore. Use require('os').homedir()
instead.
Node.js 4
os.homedir()
ponyfill
$ npm install --save os-homedir
const osHomedir = require('os-homedir');
console.log(osHomedir());
//=> '/Users/sindresorhus'
- user-home - Same as this module but caches the result
- home-or-tmp - Get the user home directory with fallback to the system temp directory
Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.