How to use arch - 1 common examples

To help you get started, we’ve selected a few arch 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 MovieCast / desktop / src / config.js View on Github external
// App constants
export const APP_NAME = pkg.productName;
export const APP_VERSION = pkg.version;

// Path constants
export const ROOT_PATH = path.join(__dirname, '..');
export const CONFIG_PATH = path.dirname(appConfig.filePath);
export const DEFAULT_DOWNLOAD_PATH = getDefaultDownloadPath();

// Window constants
export const WINDOW_MAIN = getWindowPath('app.html'); // Ples rename to main.html
export const WINDOW_TORRENTENGINE = getWindowPath('torrentEngine.html');

// Generic constants
export const DELAYED_INIT = 3000; /* 3 seconds */
export const OS_SYSARCH = arch() === 'x64' ? 'x64' : 'ia32';

function getDefaultDownloadPath() {
  return getPath('downloads');
}

function getPath(key) {
  if (!process.versions.electron) {
    // Node.js process
    return '';
  } else if (process.type === 'renderer') {
    // Electron renderer process
    return electron.remote.app.getPath(key);
  }

  // Electron main process
  return electron.app.getPath(key);

arch

Better `os.arch()` for node and the browser -- detect OS architecture

MIT
Latest version published 9 months ago

Package Health Score

74 / 100
Full package analysis

Popular arch functions