How to use the osenv.home function in osenv

To help you get started, we’ve selected a few osenv examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dominictarr / npmd / config.js View on Github external
var path     = require('path')
var rc       = require('rc')
var optimist = require('optimist')
var toCC     = require('to-camel-case')
var osenv    = require('osenv')

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

module.exports = (function () {
  // *** vvv Copied this stuff out of npmconf **********************
  var uidOrPid = process.getuid ? process.getuid() : process.pid

  if (home) process.env.HOME = home
  else home = path.resolve(temp, "npm-" + uidOrPid)

  var cacheExtra = process.platform === "win32" ? "npm-cache" : ".npm"
  var cacheRoot = process.platform === "win32" && process.env.APPDATA || home
  var cache = path.resolve(cacheRoot, cacheExtra)
  // *** ^^^ Copied this stuff out of npmconf **********************

  var config = rc('npmd', {
    dbPath: path.join(process.env.HOME, '.npmd'),
github irods-contrib / irods-cloud-browser / irods-cloud-frontend / node_modules / bower / node_modules / bower-config / lib / util / rc.js View on Github external
var path = require('path');
var fs = require('graceful-fs');
var optimist = require('optimist');
var osenv = require('osenv');
var object = require('mout/object');
var string = require('mout/string');
var paths = require('./paths');
var defaults = require('./defaults');

var win = process.platform === 'win32';
var home = osenv.home();

function rc(name, cwd, argv) {
    var argvConfig;

    argv = argv || optimist.argv;

    // Parse --config.foo=false
    argvConfig = object.map(argv.config || {}, function (value) {
        return value === 'false' ? false : value;
    });

    // If we have specified a cwd then use this as the base for getting config.
    cwd = argvConfig.cwd ? argvConfig.cwd : cwd;

    if (cwd) {
        return object.deepMixIn.apply(null, [
github bower / bower / packages / bower-config / lib / util / rc.js View on Github external
var path = require('path');
var fs = require('graceful-fs');
var optimist = require('optimist');
var osenv = require('osenv');
var object = require('mout/object');
var string = require('mout/string');
var paths = require('./paths');
var defaults = require('./defaults');

var win = process.platform === 'win32';
var home = osenv.home();

function rc(name, cwd, argv) {
    var argvConfig;

    argv = argv || optimist.argv;

    // Parse --config.foo=false
    argvConfig = object.map(argv.config || {}, function(value) {
        return value === 'false' ? false : value;
    });

    // If we have specified a cwd then use this as the base for getting config.
    cwd = argvConfig.cwd ? argvConfig.cwd : cwd;

    if (cwd) {
        return object.deepMixIn.apply(null, [
github feflow / builder-webpack4 / lib / builder.js View on Github external
static setResolveLoaderPath(runtime) {
        const jbRuntime = runtime || 'runtime-now-6';
        const resolveLoaderPath = path.join(osenv.home(), './.feflow/node_modules');
        // Loader在捷豹平台的查找路径
        const jbLoaderPath = `/data/frontend/install/AlloyDist/${jbRuntime}/node_modules`;

        return {
            modules: [
                path.resolve(__dirname, "../node_modules"),
                resolveLoaderPath,
                jbLoaderPath,
            ]
        };
    }
}
github nicolaspanel / node-svm / lib / util / read-config.js View on Github external
'use strict';

var path = require('path');
var fs = require('graceful-fs');
var optimist = require('optimist');
var osenv = require('osenv');
var object = require('mout/object');
var string = require('mout/string');
var paths = require('./paths');

var win = process.platform === 'win32';
var home = osenv.home();

function parse(content, file) {
    var error;

    if (!content.trim().length) {
        return {};
    }

    try {
        return JSON.parse(content);
    } catch (e) {
        if (file) {
            error = new Error('Unable to parse ' + file + ': ' + e.message);
        } else {
            error = new Error('Unable to parse rc config: ' + e.message);
        }
github andrewrk / groovebasin / lib / mpdconf.js View on Github external
MpdConf.prototype.setDefaultState = function(){
  this.state = {};
  this.state.audio_httpd = {
    format: 'ogg',
    quality: 6,
    port: 16243
  };
  this.state.audio_pulse = null;
  this.state.audio_alsa = null;
  this.state.audio_oss = null;
  this.state.run_dir = null;
  this.state.music_directory = path.join(osenv.home(), 'music');
};
github paulbjensen / cross-platform-desktop-applications / chapter-09 / lorikeet-electron / features / step_definitions / image_steps.js View on Github external
this.When(/^I double click on the "([^"]*)" folder$/, function (folderName, callback) {
    var folderPath = path.join(osenv.home(),folderName);
    this.app.client.doubleClick(`//img[@data-filepath="${folderPath}"]`)
    .then(() => { callback(); });
  });
github NativeScript / nativescript-cloud / lib / services / kinvey-user-service.ts View on Github external
private getUserFilePath(): string {
		return join(this.$hostInfo.isWindows ? join(process.env.AppData) :
			this.$hostInfo.isDarwin ? join(home(), "Library", "Application Support") : join(home(), ".config"),
			"KinveyStudio",
			"kinveyUser.json");
	}
}

osenv

Look up environment settings specific to different operating systems

ISC
Latest version published 7 years ago

Package Health Score

55 / 100
Full package analysis

Popular osenv functions