Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@zkochan/npm-conf

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zkochan/npm-conf - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

7

index.js

@@ -71,2 +71,7 @@ 'use strict';

module.exports.defaults = Object.assign({}, _defaults.defaults);
Object.defineProperty(module.exports, 'defaults', {
get() {
return _defaults.defaults;
},
enumerable: true
})

329

lib/defaults.js

@@ -0,176 +1,175 @@

// Generated with `lib/make.js`
'use strict';
const os = require('os');
const path = require('path');
// Generated with `lib/make.js`
'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 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 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()
};
const umask = {
fromString: () => process.umask()
};
let home = os.homedir();
let home = os.homedir();
if (home) {
process.env.HOME = home;
} else {
home = path.resolve(temp, 'npm-' + uidOrPid);
}
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);
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;
let defaults;
let globalPrefix;
Object.defineProperty(exports, 'defaults', {
get: function () {
if (defaults) return defaults;
Object.defineProperty(exports, 'defaults', {
get: function () {
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.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);
}
}
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,
'auth-type': 'legacy',
'bin-links': true,
browser: null,
ca: null,
cafile: null,
cache: 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: null,
'package-lock': true,
'package-lock-only': false,
parseable: false,
'prefer-offline': false,
'prefer-online': false,
prefix: globalPrefix,
production: process.env.NODE_ENV === 'production',
'progress': !process.env.TRAVIS && !process.env.CI,
proxy: null,
'https-proxy': null,
'no-proxy': 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-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,
usage: false,
user: process.platform === 'win32' ? 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;
}
})
defaults = {
access: null,
'allow-same-version': false,
'always-auth': false,
also: null,
audit: true,
'auth-type': 'legacy',
'bin-links': true,
browser: null,
ca: null,
cafile: null,
cache: 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: null,
'package-lock': true,
'package-lock-only': false,
parseable: false,
'prefer-offline': false,
'prefer-online': false,
prefix: globalPrefix,
production: process.env.NODE_ENV === 'production',
'progress': !process.env.TRAVIS && !process.env.CI,
proxy: null,
'https-proxy': null,
'no-proxy': 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-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,
usage: false,
user: process.platform === 'win32' ? 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;
}
});

@@ -8,52 +8,60 @@ 'use strict';

const defaultsTemplate = body => `
// Generated with \`lib/make.js\`
'use strict';
const os = require('os');
const path = require('path');
const INDENT_REGEXP = /^((?: )+)/gmu;
/** @param {string} match */
const INDENT_REPLACER = match => {
return '\t'.repeat(match.length >>> 1);
};
const temp = os.tmpdir();
const uidOrPid = process.getuid ? process.getuid() : process.pid;
const hasUnicode = () => true;
const isWindows = process.platform === 'win32';
/** @param {string} body */
const defaultsTemplate = body => `\
// Generated with \`lib/make.js\`
'use strict';
const os = require('os');
const path = require('path');
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 temp = os.tmpdir();
const uidOrPid = process.getuid ? process.getuid() : process.pid;
const hasUnicode = () => true;
const isWindows = process.platform === 'win32';
const umask = {
fromString: () => process.umask()
};
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')
};
let home = os.homedir();
const umask = {
fromString: () => process.umask()
};
if (home) {
process.env.HOME = home;
} else {
home = path.resolve(temp, 'npm-' + uidOrPid);
}
let home = os.homedir();
const cacheExtra = process.platform === 'win32' ? 'npm-cache' : '.npm';
const cacheRoot = process.platform === 'win32' ? process.env.APPDATA : home;
const cache = path.resolve(cacheRoot, cacheExtra);
if (home) {
process.env.HOME = home;
} else {
home = path.resolve(temp, 'npm-' + uidOrPid);
}
let defaults;
let globalPrefix;
const cacheExtra = process.platform === 'win32' ? 'npm-cache' : '.npm';
const cacheRoot = process.platform === 'win32' ? process.env.APPDATA : home;
const cache = path.resolve(cacheRoot, cacheExtra);
${body}
let defaults;
let globalPrefix;
${body.replace(INDENT_REGEXP, INDENT_REPLACER)};
`;
const typesTemplate = body => `
// Generated with \`lib/make.js\`
'use strict';
const path = require('path');
const Stream = require('stream').Stream;
const url = require('url');
/** @param {string} body */
const typesTemplate = body => `\
// Generated with \`lib/make.js\`
'use strict';
const path = require('path');
const Stream = require('stream').Stream;
const url = require('url');
const Umask = () => {};
const getLocalAddresses = () => [];
const semver = () => {};
const Umask = () => {};
const getLocalAddresses = () => [];
const semver = () => {};
${body}
${body.replace(INDENT_REGEXP, INDENT_REPLACER)};
`;

@@ -91,3 +99,3 @@

fs.writeFileSync(path.join(__dirname, 'defaults.js'), defaultsTemplate(generate(defs, {}, ast).code));
fs.writeFileSync(path.join(__dirname, 'types.js'), typesTemplate(generate(types, {}, ast).code));
fs.writeFileSync(path.join(__dirname, 'defaults.js'), defaultsTemplate(generate(defs).code));
fs.writeFileSync(path.join(__dirname, 'types.js'), typesTemplate(generate(types).code));

@@ -0,134 +1,133 @@

// Generated with `lib/make.js`
'use strict';
const path = require('path');
const Stream = require('stream').Stream;
const url = require('url');
// Generated with `lib/make.js`
'use strict';
const path = require('path');
const Stream = require('stream').Stream;
const url = require('url');
const Umask = () => {};
const getLocalAddresses = () => [];
const semver = () => {};
const Umask = () => {};
const getLocalAddresses = () => [];
const semver = () => {};
exports.types = {
access: [null, 'restricted', 'public'],
'allow-same-version': Boolean,
'always-auth': Boolean,
also: [null, 'dev', 'development'],
audit: Boolean,
'auth-type': ['legacy', 'sso', 'saml', 'oauth'],
'bin-links': Boolean,
browser: [null, String],
ca: [null, String, Array],
cafile: path,
cache: path,
'cache-lock-stale': Number,
'cache-lock-retries': Number,
'cache-lock-wait': Number,
'cache-max': Number,
'cache-min': Number,
cert: [null, String],
cidr: [null, String, Array],
color: ['always', Boolean],
depth: Number,
description: Boolean,
dev: Boolean,
'dry-run': Boolean,
editor: String,
'engine-strict': Boolean,
force: Boolean,
'fetch-retries': Number,
'fetch-retry-factor': Number,
'fetch-retry-mintimeout': Number,
'fetch-retry-maxtimeout': Number,
git: String,
'git-tag-version': Boolean,
'commit-hooks': Boolean,
global: Boolean,
globalconfig: path,
'global-style': Boolean,
group: [Number, String],
'https-proxy': [null, url],
'user-agent': String,
'ham-it-up': Boolean,
'heading': String,
'if-present': Boolean,
'ignore-prepublish': Boolean,
'ignore-scripts': Boolean,
'init-module': path,
'init-author-name': String,
'init-author-email': String,
'init-author-url': ['', url],
'init-license': String,
'init-version': semver,
json: Boolean,
key: [null, String],
'legacy-bundling': Boolean,
link: Boolean,
// local-address must be listed as an IP for a local network interface
// must be IPv4 due to node bug
'local-address': getLocalAddresses(),
loglevel: ['silent', 'error', 'warn', 'notice', 'http', 'timing', 'info', 'verbose', 'silly'],
logstream: Stream,
'logs-max': Number,
long: Boolean,
maxsockets: Number,
message: String,
'metrics-registry': [null, String],
'node-options': [null, String],
'node-version': [null, semver],
'no-proxy': [null, String, Array],
offline: Boolean,
'onload-script': [null, String],
only: [null, 'dev', 'development', 'prod', 'production'],
optional: Boolean,
'package-lock': Boolean,
otp: [null, String],
'package-lock-only': Boolean,
parseable: Boolean,
'prefer-offline': Boolean,
'prefer-online': Boolean,
prefix: path,
production: Boolean,
progress: Boolean,
proxy: [null, false, url],
// allow proxy to be disabled explicitly
'read-only': Boolean,
'rebuild-bundle': Boolean,
registry: [null, url],
rollback: Boolean,
save: Boolean,
'save-bundle': Boolean,
'save-dev': Boolean,
'save-exact': Boolean,
'save-optional': Boolean,
'save-prefix': String,
'save-prod': Boolean,
scope: String,
'script-shell': [null, String],
'scripts-prepend-node-path': [false, true, 'auto', 'warn-only'],
searchopts: String,
searchexclude: [null, String],
searchlimit: Number,
searchstaleness: Number,
'send-metrics': Boolean,
shell: String,
shrinkwrap: Boolean,
'sign-git-tag': Boolean,
'sso-poll-frequency': Number,
'sso-type': [null, 'oauth', 'saml'],
'strict-ssl': Boolean,
tag: String,
timing: Boolean,
tmp: path,
unicode: Boolean,
'unsafe-perm': Boolean,
usage: Boolean,
user: [Number, String],
userconfig: path,
umask: Umask,
version: Boolean,
'tag-version-prefix': String,
versions: Boolean,
viewer: String,
_exit: Boolean
}
exports.types = {
access: [null, 'restricted', 'public'],
'allow-same-version': Boolean,
'always-auth': Boolean,
also: [null, 'dev', 'development'],
audit: Boolean,
'auth-type': ['legacy', 'sso', 'saml', 'oauth'],
'bin-links': Boolean,
browser: [null, String],
ca: [null, String, Array],
cafile: path,
cache: path,
'cache-lock-stale': Number,
'cache-lock-retries': Number,
'cache-lock-wait': Number,
'cache-max': Number,
'cache-min': Number,
cert: [null, String],
cidr: [null, String, Array],
color: ['always', Boolean],
depth: Number,
description: Boolean,
dev: Boolean,
'dry-run': Boolean,
editor: String,
'engine-strict': Boolean,
force: Boolean,
'fetch-retries': Number,
'fetch-retry-factor': Number,
'fetch-retry-mintimeout': Number,
'fetch-retry-maxtimeout': Number,
git: String,
'git-tag-version': Boolean,
'commit-hooks': Boolean,
global: Boolean,
globalconfig: path,
'global-style': Boolean,
group: [Number, String],
'https-proxy': [null, url],
'user-agent': String,
'ham-it-up': Boolean,
'heading': String,
'if-present': Boolean,
'ignore-prepublish': Boolean,
'ignore-scripts': Boolean,
'init-module': path,
'init-author-name': String,
'init-author-email': String,
'init-author-url': ['', url],
'init-license': String,
'init-version': semver,
json: Boolean,
key: [null, String],
'legacy-bundling': Boolean,
link: Boolean,
// local-address must be listed as an IP for a local network interface
// must be IPv4 due to node bug
'local-address': getLocalAddresses(),
loglevel: ['silent', 'error', 'warn', 'notice', 'http', 'timing', 'info', 'verbose', 'silly'],
logstream: Stream,
'logs-max': Number,
long: Boolean,
maxsockets: Number,
message: String,
'metrics-registry': [null, String],
'node-options': [null, String],
'node-version': [null, semver],
'no-proxy': [null, String, Array],
offline: Boolean,
'onload-script': [null, String],
only: [null, 'dev', 'development', 'prod', 'production'],
optional: Boolean,
'package-lock': Boolean,
otp: [null, String],
'package-lock-only': Boolean,
parseable: Boolean,
'prefer-offline': Boolean,
'prefer-online': Boolean,
prefix: path,
production: Boolean,
progress: Boolean,
proxy: [null, false, url],
// allow proxy to be disabled explicitly
'read-only': Boolean,
'rebuild-bundle': Boolean,
registry: [null, url],
rollback: Boolean,
save: Boolean,
'save-bundle': Boolean,
'save-dev': Boolean,
'save-exact': Boolean,
'save-optional': Boolean,
'save-prefix': String,
'save-prod': Boolean,
scope: String,
'script-shell': [null, String],
'scripts-prepend-node-path': [false, true, 'auto', 'warn-only'],
searchopts: String,
searchexclude: [null, String],
searchlimit: Number,
searchstaleness: Number,
'send-metrics': Boolean,
shell: String,
shrinkwrap: Boolean,
'sign-git-tag': Boolean,
'sso-poll-frequency': Number,
'sso-type': [null, 'oauth', 'saml'],
'strict-ssl': Boolean,
tag: String,
timing: Boolean,
tmp: path,
unicode: Boolean,
'unsafe-perm': Boolean,
usage: Boolean,
user: [Number, String],
userconfig: path,
umask: Umask,
version: Boolean,
'tag-version-prefix': String,
versions: Boolean,
viewer: String,
_exit: Boolean
};

@@ -117,3 +117,7 @@ 'use strict';

if (files.indexOf('node_modules') !== -1 || files.indexOf('package.json') !== -1) {
if (
files.includes('node_modules') ||
files.includes('package.json') ||
files.includes('pnpm-workspace.yaml')
) {
return name;

@@ -120,0 +124,0 @@ }

{
"name": "@zkochan/npm-conf",
"version": "2.0.0",
"version": "2.0.1",
"description": "Get the npm config",

@@ -40,5 +40,4 @@ "license": "MIT",

"jest": "^25.1.0",
"npm": "^5.0.4",
"pify": "^4.0.1"
"npm": "^5.0.4"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc