123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- // Generated with `lib/make.js`
- /* eslint-disable no-useless-concat */
- "use strict";
- const os = require("os");
- const path = require("path");
- const temp = os.tmpdir();
- const uidOrPid = process.getuid ? process.getuid() : process.pid;
- const hasUnicode = () => true;
- const isWindows = process.platform === "win32";
- const osenv = {
- editor: () => process.env.EDITOR || process.env.VISUAL || (isWindows ? "notepad.exe" : "vi"),
- shell: () => (isWindows ? process.env.COMSPEC || "cmd.exe" : process.env.SHELL || "/bin/bash"),
- };
- const umask = {
- fromString: () => process.umask(),
- };
- let home = os.homedir();
- if (home) {
- process.env.HOME = home;
- } else {
- home = path.resolve(temp, `npm-${uidOrPid}`);
- }
- const cacheExtra = process.platform === "win32" ? "npm-cache" : ".npm";
- const cacheRoot = (process.platform === "win32" && process.env.APPDATA) || home;
- const cache = path.resolve(cacheRoot, cacheExtra);
- let defaults;
- let globalPrefix;
- Object.defineProperty(exports, "defaults", {
- get() {
- if (defaults) {
- return defaults;
- }
- if (process.env.PREFIX) {
- globalPrefix = process.env.PREFIX;
- } else if (process.platform === "win32") {
- // c:\node\node.exe --> prefix=c:\node\
- globalPrefix = path.dirname(process.execPath);
- } else {
- // /usr/local/bin/node --> prefix=/usr/local
- globalPrefix = path.dirname(path.dirname(process.execPath)); // destdir only is respected on Unix
- if (process.env.DESTDIR) {
- globalPrefix = path.join(process.env.DESTDIR, globalPrefix);
- }
- }
- defaults = {
- access: null,
- "allow-same-version": false,
- "always-auth": false,
- also: null,
- audit: true,
- "audit-level": "low",
- "auth-type": "legacy",
- "bin-links": true,
- browser: null,
- ca: null,
- cafile: null,
- cache,
- "cache-lock-stale": 60000,
- "cache-lock-retries": 10,
- "cache-lock-wait": 10000,
- "cache-max": Infinity,
- "cache-min": 10,
- cert: null,
- cidr: null,
- color: process.env.NO_COLOR == null,
- depth: Infinity,
- description: true,
- dev: false,
- "dry-run": false,
- editor: osenv.editor(),
- "engine-strict": false,
- force: false,
- "fetch-retries": 2,
- "fetch-retry-factor": 10,
- "fetch-retry-mintimeout": 10000,
- "fetch-retry-maxtimeout": 60000,
- git: "git",
- "git-tag-version": true,
- "commit-hooks": true,
- global: false,
- globalconfig: path.resolve(globalPrefix, "etc", "npmrc"),
- "global-style": false,
- group: process.platform === "win32" ? 0 : process.env.SUDO_GID || (process.getgid && process.getgid()),
- "ham-it-up": false,
- heading: "npm",
- "if-present": false,
- "ignore-prepublish": false,
- "ignore-scripts": false,
- "init-module": path.resolve(home, ".npm-init.js"),
- "init-author-name": "",
- "init-author-email": "",
- "init-author-url": "",
- "init-version": "1.0.0",
- "init-license": "ISC",
- json: false,
- key: null,
- "legacy-bundling": false,
- link: false,
- "local-address": undefined,
- loglevel: "notice",
- logstream: process.stderr,
- "logs-max": 10,
- long: false,
- maxsockets: 50,
- message: "%s",
- "metrics-registry": null,
- "node-options": null,
- "node-version": process.version,
- offline: false,
- "onload-script": false,
- only: null,
- optional: true,
- otp: undefined,
- "package-lock": true,
- "package-lock-only": false,
- parseable: false,
- "prefer-offline": false,
- "prefer-online": false,
- prefix: globalPrefix,
- preid: "",
- production: process.env.NODE_ENV === "production",
- progress: !process.env.TRAVIS && !process.env.CI,
- proxy: null,
- "https-proxy": null,
- noproxy: null,
- "user-agent": "npm/{npm-version} " + "node/{node-version} " + "{platform} " + "{arch}",
- "read-only": false,
- "rebuild-bundle": true,
- registry: "https://registry.npmjs.org/",
- rollback: true,
- save: true,
- "save-bundle": false,
- "save-dev": false,
- "save-exact": false,
- "save-optional": false,
- "save-prefix": "^",
- "save-prod": false,
- scope: "",
- "script-shell": null,
- "scripts-prepend-node-path": "warn-only",
- searchopts: "",
- searchexclude: null,
- searchlimit: 20,
- searchstaleness: 15 * 60,
- "send-metrics": false,
- shell: osenv.shell(),
- shrinkwrap: true,
- "sign-git-commit": false,
- "sign-git-tag": false,
- "sso-poll-frequency": 500,
- "sso-type": "oauth",
- "strict-ssl": true,
- tag: "latest",
- "tag-version-prefix": "v",
- timing: false,
- tmp: temp,
- unicode: hasUnicode(),
- "unsafe-perm":
- process.platform === "win32" ||
- process.platform === "cygwin" ||
- !(process.getuid && process.setuid && process.getgid && process.setgid) ||
- process.getuid() !== 0,
- "update-notifier": true,
- usage: false,
- user: process.platform === "win32" || os.type() === "OS400" ? 0 : "nobody",
- userconfig: path.resolve(home, ".npmrc"),
- umask: process.umask ? process.umask() : umask.fromString("022"),
- version: false,
- versions: false,
- viewer: process.platform === "win32" ? "browser" : "man",
- _exit: true,
- };
- return defaults;
- },
- });
|