How to use the home function from osenv

Find comprehensive JavaScript osenv.home code examples handpicked from public code repositorys.

71
72
73
74
75
76
77
78
79
80
else stableFamily = stableFamily.major + '.' + stableFamily.minor

var defaults

var temp = osenv.tmpdir()
var home = osenv.home()

var uidOrPid = process.getuid ? process.getuid() : process.pid

if (home) process.env.HOME = home
fork icon49
star icon518
watch icon38

18
19
20
21
22
23
24
25
26
27
};

// Guess some needed properties based on the user OS
var user = (osenv.user() || generateFakeUser()).replace(/\\/g, '-');
var tmp = path.join(os.tmpdir ? os.tmpdir() : os.tmpDir(), user);
var home = osenv.home();
var base;

// Fallbacks for windows
if (process.platform === 'win32') {
fork icon47
star icon295
watch icon16

39
40
41
42
43
44
45
46
47
48

## osenv.tmpdir()

The place where temporary files should be created.

## osenv.home()

No place like it.

## osenv.path()
fork icon19
star icon22
watch icon13

13
14
15
16
17
18
19
20
21
22
var prog = gyp()
var completed = false
prog.parseArgv(process.argv)
prog.devDir = prog.opts.devdir

var homeDir = osenv.home()
if (prog.devDir) {
  prog.devDir = prog.devDir.replace(/^~/, homeDir)
} else if (homeDir) {
  prog.devDir = path.resolve(homeDir, '.node-gyp')
fork icon7
star icon8
watch icon3

18
19
20
21
22
23
24
25
26
27
We require this here instead of at the top of the file so that on the
web platform, it doesn't try to do any detection (and fail, because we
are not shimming process).
*/

const homePath = osenv.home();

/*
If the user doesn't have a Documents folder, check for "My Documents"
instead (thanks Windows).
fork icon240
star icon0
watch icon2