Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
unmet = color.bgBlack(color.red(unmet))
}
}
data = unmet + ' ' + d + '@' + data.requiredBy
} else {
data = d + '@' + data.requiredBy
}
return data
}
var out = {}
// the top level is a bit special.
out.label = data._id || ''
if (data._found === true && data._id) {
if (npm.color) {
out.label = color.bgBlack(color.yellow(out.label.trim())) + ' '
} else {
out.label = out.label.trim() + ' '
}
}
if (data.link) out.label += ' -> ' + data.link
if (data.invalid) {
if (data.realName !== data.name) out.label += ' (' + data.realName + ')'
var invalid = 'invalid'
if (npm.color) invalid = color.bgBlack(color.red(invalid))
out.label += ' ' + invalid
}
if (data.peerInvalid) {
var peerInvalid = 'peer invalid'
if (npm.color) peerInvalid = color.bgBlack(color.red(peerInvalid))
function makeArchy_ (data, long, dir, depth, parent, d) {
if (data.missing) {
if (depth - 1 <= npm.config.get('depth')) {
// just missing
var unmet = 'UNMET ' + (data.optional ? 'OPTIONAL ' : '') + 'DEPENDENCY'
if (npm.color) {
if (data.optional) {
unmet = color.bgBlack(color.yellow(unmet))
} else {
unmet = color.bgBlack(color.red(unmet))
}
}
var label = data._id || (d + '@' + data.requiredBy)
if (data._found === 'explicit' && data._id) {
if (npm.color) {
label = color.bgBlack(color.yellow(label.trim())) + ' '
} else {
label = label.trim() + ' '
}
}
return {
label: unmet + ' ' + label,
nodes: Object.keys(data.dependencies || {})
.sort(alphasort).filter(function (d) {
function makeArchy_ (data, long, dir, depth, parent, d) {
if (data.missing) {
if (depth - 1 <= npm.config.get('depth')) {
// just missing
var unmet = 'UNMET ' + (data.optional ? 'OPTIONAL ' : '') + 'DEPENDENCY'
if (npm.color) {
if (data.optional) {
unmet = color.bgBlack(color.yellow(unmet))
} else {
unmet = color.bgBlack(color.red(unmet))
}
}
data = unmet + ' ' + d + '@' + data.requiredBy
} else {
data = d + '@' + data.requiredBy
}
return data
}
var out = {}
// the top level is a bit special.
out.label = data._id || ''
if (data._found === true && data._id) {
if (npm.color) {
module.exports = print;
var tree = require('snyk-tree');
var colour = require('ansicolors');
var path = require('path');
var ext = colour.bgBlack(colour.green('extraneous'));
var bundled = colour.bgBlack(colour.yellow('bundled'));
function print(args, res) {
res.version += ' ' + path.dirname(res.__filename);
var printed = '';
printed = tree(res, function (leaf) {
var label = leaf.full;
if (leaf.extraneous) {
label += ' ' + ext;
}
if (leaf.bundled) {
label += ' ' + bundled;
}
if (leaf.shrinkwrap) {
})
}
} else {
return {label: d + '@' + data.requiredBy}
}
}
var out = {}
if (data._requested && data._requested.type === 'alias') {
out.label = `${d}@npm:${data._id}`
} else {
out.label = data._id || ''
}
if (data._found === 'explicit' && data._id) {
if (npm.color) {
out.label = color.bgBlack(color.yellow(out.label.trim())) + ' '
} else {
out.label = out.label.trim() + ' '
}
}
if (data.link) out.label += ' -> ' + data.link
if (data._deduped) {
if (npm.color) {
out.label += ' ' + color.brightBlack('deduped')
} else {
out.label += ' deduped'
}
}
if (data.invalid) {
if (data.realName !== data.name) out.label += ' (' + data.realName + ')'
notifier.update.latest !== pkg.version &&
!isCI
) {
const color = require('ansicolors')
const useColor = npm.config.get('color')
const useUnicode = npm.config.get('unicode')
const old = notifier.update.current
const latest = notifier.update.latest
let type = notifier.update.type
if (useColor) {
switch (type) {
case 'major':
type = color.red(type)
break
case 'minor':
type = color.yellow(type)
break
case 'patch':
type = color.green(type)
break
}
}
const changelog = `https://github.com/npm/cli/releases/tag/v${latest}`
notifier.notify({
message: `New ${type} version of ${pkg.name} available! ${
useColor ? color.red(old) : old
} ${useUnicode ? '→' : '->'} ${
useColor ? color.green(latest) : latest
}\n` +
`${
useColor ? color.yellow('Changelog:') : 'Changelog:'
} ${
deps: Object.keys(manifest.dependencies || {}).map((dep) => {
return `${color.yellow(dep)}: ${manifest.dependencies[dep]}`
}),
publisher: manifest._npmUser && unparsePerson({
var levelColor = function (code) {
if (code < 299) {
return ansicolors.green(code);
}
if (code < 399) {
return ansicolors.yellow(code);
}
if (code < 499) {
return ansicolors.magenta(code);
}
return ansicolors.red(code);
};