Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
tarball.bundled &&
tarball.bundled.length && {
name: "own files:",
value: tarball.files.length,
},
tarball.entryCount && { name: "total files:", value: tarball.entryCount },
].filter(x => x),
{
include: ["name", "value"],
showHeaders: false,
}
)
);
// an empty line
log.notice("", "");
}
}).then(() => {
log.notice('profile', 'Enabling two factor authentication for ' + mode)
return readUserInfo.password()
}).then((password) => {
info.tfa.password = password
function ping (args, silent, cb) {
if (typeof cb !== 'function') {
cb = silent
silent = false
}
const opts = PingConfig(npmConfig())
const registry = opts.registry
log.notice('PING', registry)
const start = Date.now()
return fetch('/-/ping?write=true', opts).then(
res => res.json().catch(() => ({}))
).then(details => {
if (silent) {
} else {
const time = Date.now() - start
log.notice('PONG', `${time / 1000}ms`)
if (npm.config.get('json')) {
output(JSON.stringify({
registry,
time,
details
}, null, 2))
} else if (Object.keys(details).length) {
log.notice('PONG', `${JSON.stringify(details, null, 2)}`)
tarball.bundled.forEach((name) => log.notice('', name))
}
toSave.forEach(function (pkg) {
if (pkg.save) tree.package[pkg.save][pkg.name] = pkg.spec
const movedFrom = []
for (let saveType of types) {
if (
pkg.save !== saveType &&
tree.package[saveType] &&
tree.package[saveType][pkg.name]
) {
movedFrom.push(saveType)
delete tree.package[saveType][pkg.name]
}
}
if (movedFrom.length) {
log.notice('save', `${pkg.name} is being moved from ${movedFrom.join(' and ')} to ${pkg.save}`)
}
if (saveBundle) {
var ii = bundle.indexOf(pkg.name)
if (ii === -1) bundle.push(pkg.name)
}
})
).then(() => {
log.notice('', `${PKGLOCK} has been renamed to ${SHRINKWRAP}. ${SHRINKWRAP} will be used for future installations.`)
return readFile(path.resolve(npm.prefix, SHRINKWRAP)).then((d) => {
return JSON.parse(d)
})
}, (err) => {
if (err.code !== 'ENOENT') {
};
}),
{
include: ["size", "path"],
showHeaders: false,
}
)
);
}
if (tarball.bundled && tarball.bundled.length) {
log.notice("=== Bundled Dependencies ===");
tarball.bundled.forEach(name => log.notice("", name));
}
log.notice("=== Tarball Details ===");
log.notice(
"",
columnify(
[
{ name: "name:", value: tarball.name },
{ name: "version:", value: tarball.version },
tarball.filename && { name: "filename:", value: tarball.filename },
tarball.size && { name: "package size:", value: byteSize(tarball.size) },
tarball.unpackedSize && { name: "unpacked size:", value: byteSize(tarball.unpackedSize) },
tarball.shasum && { name: "shasum:", value: tarball.shasum },
tarball.integrity && { name: "integrity:", value: elideIntegrity(tarball.integrity) },
tarball.bundled &&
tarball.bundled.length && {
name: "bundled deps:",
value: tarball.bundled.length,
},
function logContents (tarball) {
log.notice('')
log.notice('', `${npm.config.get('unicode') ? '📦 ' : 'package:'} ${tarball.name}@${tarball.version}`)
log.notice('=== Tarball Contents ===')
if (tarball.files.length) {
log.notice('', columnify(tarball.files.map((f) => {
const bytes = byteSize(f.size)
return {path: f.path, size: `${bytes.value}${bytes.unit}`}
}), {
include: ['size', 'path'],
showHeaders: false
}))
}
if (tarball.bundled.length) {
log.notice('=== Bundled Dependencies ===')
tarball.bundled.forEach((name) => log.notice('', name))
}
log.notice('=== Tarball Details ===')
log.notice('', columnify([
{name: 'name:', value: tarball.name},
{name: 'version:', value: tarball.version},
tarball.filename && {name: 'filename:', value: tarball.filename},
{name: 'package size:', value: byteSize(tarball.size)},
{name: 'unpacked size:', value: byteSize(tarball.unpackedSize)},
{name: 'shasum:', value: tarball.shasum},
{
name: 'integrity:',
value: tarball.integrity.toString().substr(0, 20) + '[...]' + tarball.integrity.toString().substr(80)},
tarball.bundled.length && {name: 'bundled deps:', value: tarball.bundled.length},
tarball.bundled.length && {name: 'bundled files:', value: tarball.entryCount - tarball.files.length},
tarball.bundled.length && {name: 'own files:', value: tarball.files.length},
const bytes = byteSize(f.size);
return {
path: f.path,
size: `${bytes.value}${bytes.unit}`,
};
}),
{
include: ["size", "path"],
showHeaders: false,
}
)
);
}
if (tarball.bundled && tarball.bundled.length) {
log.notice("=== Bundled Dependencies ===");
tarball.bundled.forEach(name => log.notice("", name));
}
log.notice("=== Tarball Details ===");
log.notice(
"",
columnify(
[
{ name: "name:", value: tarball.name },
{ name: "version:", value: tarball.version },
tarball.filename && { name: "filename:", value: tarball.filename },
tarball.size && { name: "package size:", value: byteSize(tarball.size) },
tarball.unpackedSize && { name: "unpacked size:", value: byteSize(tarball.unpackedSize) },
tarball.shasum && { name: "shasum:", value: tarball.shasum },
tarball.integrity && { name: "integrity:", value: elideIntegrity(tarball.integrity) },
tarball.bundled &&
log.notice('=== Tarball Contents ===')
if (tarball.files.length) {
log.notice('', columnify(tarball.files.map((f) => {
const bytes = byteSize(f.size)
return {path: f.path, size: `${bytes.value}${bytes.unit}`}
}), {
include: ['size', 'path'],
showHeaders: false
}))
}
if (tarball.bundled.length) {
log.notice('=== Bundled Dependencies ===')
tarball.bundled.forEach((name) => log.notice('', name))
}
log.notice('=== Tarball Details ===')
log.notice('', columnify([
{name: 'name:', value: tarball.name},
{name: 'version:', value: tarball.version},
tarball.filename && {name: 'filename:', value: tarball.filename},
{name: 'package size:', value: byteSize(tarball.size)},
{name: 'unpacked size:', value: byteSize(tarball.unpackedSize)},
{name: 'shasum:', value: tarball.shasum},
{
name: 'integrity:',
value: tarball.integrity.toString().substr(0, 20) + '[...]' + tarball.integrity.toString().substr(80)},
tarball.bundled.length && {name: 'bundled deps:', value: tarball.bundled.length},
tarball.bundled.length && {name: 'bundled files:', value: tarball.entryCount - tarball.files.length},
tarball.bundled.length && {name: 'own files:', value: tarball.files.length},
{name: 'total files:', value: tarball.entryCount}
].filter((x) => x), {
include: ['name', 'value'],
showHeaders: false