home-or-tmp
Get the user home directory with fallback to the system temp directory
Last updated 10 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm
$ cnpm install home-or-tmp 
SYNC missed versions from official npm registry.

home-or-tmp Build Status

Get the user home directory with fallback to the system temp directory

Useful in cases where the home directory either isn't set or doesn't exist.

Install

$ npm install --save home-or-tmp

Usage

const homeOrTmp = require('home-or-tmp');

console.log(homeOrTmp);
//=> '/Users/sindresorhus'

// And if there is no home directory:

console.log(homeOrTmp);
//=> '/var/folders/m3/5574nnhn0yj488ccryqr7tc80000gn/T'

License

MIT © Sindre Sorhus

Current Tags

  • 4.0.0                                ...           latest (4 years ago)

4 Versions

  • 4.0.0                                ...           4 years ago
  • 1.0.0                                ...           10 years ago
  • 3.0.0                                ...           9 years ago
  • 2.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org